p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Click to display


Message #1 by NddyMyke@a... on Thu, 13 Sep 2001 11:04:25 EDT
In the below script Sample is the form name and Letter
is the combo box name.


<SCRIPT LANGUAGE="javascript">
<!--
function DisplayForm() 
{
if ( (document.Sample.Letter.options[0].selected) ) 
{
document.location.href = 'http://www.xyz.com?Data=A'; 
}
else if ( (document.Sample.Letter.options[1].selected)
) 
{
document.location.href = 'http://www.xyz.com?Data=B'; 
}
else if ( (document.Sample.Letter.options[2].selected)
) 
{
document.location.href = 'http://www.xyz.com?Data=C'; 
}
else if ( (document.Sample.Letter.options[3].selected)
) 
{
document.location.href = 'http://www.xyz.com?Data=D'; 
}
}
// -->
</SCRIPT>

<SELECT NAME="Letter" SIZE=1 onChange="DisplayForm()">
<OPTION VALUE="A" SELECTED>A</OPTION>
<OPTION VALUE="B">B</OPTION>
<OPTION VALUE="C">C</OPTION>
<OPTION VALUE="D">D</OPTION>
</SELECT>


Hope so the above code will do.




--- NddyMyke@a... wrote:
> 
> I have a combo drop down box populated by recordset
> from the database.
> I have a form that is displayed when I click the
> submit 
> button after an item is selected or clicked.
> I do not want the submit button rather a function
> that will display the form when user clicks on any
> item in the combo box.
> Please help me provide the code for this click
> event.
> Thanks in advance.
>

  Return to Index