I have been looking for a way to save off the value of a drop down list box and use this value to parse data based on the value of that item.
I am using the onchange option on in the <select> however when I change items nothing happens. Can someone please help me figure this out?
Here is a scaled down version of what I am trying to do.
#!/usr/bin/perl
use strict;
print("Content-Type: text/html\n\n");
print "<html>";
print "<head>";
print qq(<script language="javascript">);
print qq(function SetOptions(the_select) {);
my $var1 = print qq(the_select.value);
print "my var: ";
print $var1;
print qq(});
print "</script>";
print "</head><body>";
print qq(<form name="formname">);
print qq( <br> Platform Type: );
print qq(<select name="selectbox1" value style="width:153px" onchange=SetOptions(formname.selectbox1.options.value)">);
print qq(<option name="HP" value="HP">HP</option>);
print qq(<option name="Linux" value="LN">Linux</option>);
print qq(<option name="PC" value="PC">PC</option>);
print qq(<option name="SUN" value="SN">SUN</option>);
print qq(<option name="Other" value="OT">Other</option>);
print qq(</select>);
print qq(</form> </body> </html>);
Thanks
I am using the onchange option on in the <select> however when I change items nothing happens. Can someone please help me figure this out?
Here is a scaled down version of what I am trying to do.
#!/usr/bin/perl
use strict;
print("Content-Type: text/html\n\n");
print "<html>";
print "<head>";
print qq(<script language="javascript">);
print qq(function SetOptions(the_select) {);
my $var1 = print qq(the_select.value);
print "my var: ";
print $var1;
print qq(});
print "</script>";
print "</head><body>";
print qq(<form name="formname">);
print qq( <br> Platform Type: );
print qq(<select name="selectbox1" value style="width:153px" onchange=SetOptions(formname.selectbox1.options.value)">);
print qq(<option name="HP" value="HP">HP</option>);
print qq(<option name="Linux" value="LN">Linux</option>);
print qq(<option name="PC" value="PC">PC</option>);
print qq(<option name="SUN" value="SN">SUN</option>);
print qq(<option name="Other" value="OT">Other</option>);
print qq(</select>);
print qq(</form> </body> </html>);
Thanks