goodlinks
10-11-2008, 05:51 AM
I'm not a javascript programmer. I have tested 2 separate colorpicker codes and they both work fine in a plain vanilla html page.
I have a page that loads a little differently. First the page is an aspx page.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="adv_style_settings.aspx.vb" Inherits="users_adv_style_settings" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Advanced User Options</title>
<script src="../iframe.js" type="text/javascript"></script>
<script src="202pop.js" type="text/javascript"></script>
<script type="text/javascript">
function loadFrm(){
if (this.options[this.selectedIndex].value!='0'){
document.getElementById('myframe').style.display='block';
document.getElementById('myframe').src=this.options[this.selectedIndex].value+'/admin/admin.php?IFLM=&page=dir_style';
}
else{
document.getElementById('myframe').style.display='none';
}
//document.getElementById('myframe').src='http://'+this.options[this.selectedindex].text;
return false;
//
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="background-color:White;">
<h1>Advanced User - Options.</h1>
<br />
<b>Select your advanced site:</b>
<asp:DropDownList ID="lstAdvanceSites" runat="server" AutoPostBack="false" />
<script type="text/javascript">
document.getElementById('<%=lstAdvanceSites.ClientID%>').onchange=loadFrm;
</script>
<br />
<b><u>Note:</u></b> When you're done with the options settings.
<a href="javascript:window.close();">CLOSE THIS Window</a>
<br />
<iframe id="iframe" frameborder="0" marginheight="0" marginwidth="0" name="myframe"
scrolling="no" style="width: 100%; height: 1000px; display: none;"></iframe>
<br /><br />
<b><u>Note:</u></b> When you're done with the options settings.
<a href="javascript:window.close();">CLOSE THIS Window</a>
<br /><br /><br />
</div>
</form>
</body>
</html>
That 2nd line of the script tags for <script src="202pop.js" type="text/javascript"></script>
loads a little popup color picker. It doesn't pop up, and I get an error that an object is expected in the admin.php file. If you look at the line:
document.getElementById('myframe').src=this.options[this.selectedIndex].value+'/admin/admin.php?IFLM=&page=dir_style';
where the middle of the page loads all the html for the page, the reference to dir_style.php contains all the form fields. It is in this dir_style.php file where the call to the color picker happens. This has to be becuase this is where I position the color picker on the page right next to the textbox field that holds the hex code for the color.
I'm happy to send any good javascript programmer a folder of some files so you can see this. Thanks for the help. :D
I have a page that loads a little differently. First the page is an aspx page.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="adv_style_settings.aspx.vb" Inherits="users_adv_style_settings" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Advanced User Options</title>
<script src="../iframe.js" type="text/javascript"></script>
<script src="202pop.js" type="text/javascript"></script>
<script type="text/javascript">
function loadFrm(){
if (this.options[this.selectedIndex].value!='0'){
document.getElementById('myframe').style.display='block';
document.getElementById('myframe').src=this.options[this.selectedIndex].value+'/admin/admin.php?IFLM=&page=dir_style';
}
else{
document.getElementById('myframe').style.display='none';
}
//document.getElementById('myframe').src='http://'+this.options[this.selectedindex].text;
return false;
//
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="background-color:White;">
<h1>Advanced User - Options.</h1>
<br />
<b>Select your advanced site:</b>
<asp:DropDownList ID="lstAdvanceSites" runat="server" AutoPostBack="false" />
<script type="text/javascript">
document.getElementById('<%=lstAdvanceSites.ClientID%>').onchange=loadFrm;
</script>
<br />
<b><u>Note:</u></b> When you're done with the options settings.
<a href="javascript:window.close();">CLOSE THIS Window</a>
<br />
<iframe id="iframe" frameborder="0" marginheight="0" marginwidth="0" name="myframe"
scrolling="no" style="width: 100%; height: 1000px; display: none;"></iframe>
<br /><br />
<b><u>Note:</u></b> When you're done with the options settings.
<a href="javascript:window.close();">CLOSE THIS Window</a>
<br /><br /><br />
</div>
</form>
</body>
</html>
That 2nd line of the script tags for <script src="202pop.js" type="text/javascript"></script>
loads a little popup color picker. It doesn't pop up, and I get an error that an object is expected in the admin.php file. If you look at the line:
document.getElementById('myframe').src=this.options[this.selectedIndex].value+'/admin/admin.php?IFLM=&page=dir_style';
where the middle of the page loads all the html for the page, the reference to dir_style.php contains all the form fields. It is in this dir_style.php file where the call to the color picker happens. This has to be becuase this is where I position the color picker on the page right next to the textbox field that holds the hex code for the color.
I'm happy to send any good javascript programmer a folder of some files so you can see this. Thanks for the help. :D