Option pull-down value help (should be easy)
Posted: Thu Apr 28, 2005 12:51 pm
Ok... I have an option pull-down that changes the maxlength of a text area onchange (that part works fine). I have the 'name' for the option as 'contact_name' so every time contact_name != "" it sends an email when form is submitted. My problem is that i am using the 'value' for the option to change the maxlength or the text area but I still need to print out a value depending on who they choose to send the email to can i print "$id" or something if i set an ID for each of the different options? This is what the <select><option> looks like before it gets sent to the IF statement that changes the maxlength.
Code: Select all
print "e;<SELECT name='contact_name' ONCHANGE='location = this.optionsїthis.selectedIndex].value;'>"e;;
print "e;<option name='' VALUE='contact.php?switch_length=nothing' $select_nothing></option>"e;;
print "e;<option name='Jéréme' VALUE='contact.php?switch_length=jereme_email' $select_jereme_email>Jéréme(eMail)</option>"e;;
print "e;<option name='Jéréme(Cell)' VALUE='contact.php?switch_length=jereme_cell' $select_jereme_cell>Jéréme(Cell)</option>"e;;
print "e;<option name='Jéréme' VALUE='contact.php?switch_length=webmaster' $select_webmaster>WebMaster</option>"e;;
print "e;</select>"e;;