Page 1 of 1

Option pull-down value help (should be easy)

Posted: Thu Apr 28, 2005 12:51 pm
by Jr
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 &quote;<SELECT name='contact_name' ONCHANGE='location = this.options&#1111;this.selectedIndex].value;'>&quote;;
	print &quote;<option name='' VALUE='contact.php?switch_length=nothing' $select_nothing></option>&quote;;
	print &quote;<option name='Jéréme' VALUE='contact.php?switch_length=jereme_email' $select_jereme_email>Jéréme(eMail)</option>&quote;;
	print &quote;<option name='Jéréme(Cell)' VALUE='contact.php?switch_length=jereme_cell' $select_jereme_cell>Jéréme(Cell)</option>&quote;;
	print &quote;<option name='Jéréme' VALUE='contact.php?switch_length=webmaster' $select_webmaster>WebMaster</option>&quote;;
print &quote;</select>&quote;;

Posted: Mon May 02, 2005 1:51 am
by n00b Saibot
Jr wrote:but I still need to print out a value depending on who they choose to send the email to
Can you explain this further... :?