RE: [PHP] verifying that a dropdown was selected
On 05-Jul-01 Richard Kurth wrote: I have a dropdown box that is for selecting the month How can I be verified that the customer has selected one of the months. I am using verification like this but it does not do what I want for a dropdown box it works fine for regular fields if ($month == ) { $month_err = font color=redPlease enter the Month of expiration!/fontbr ; $send = no; select name='month' size='1' option value='00' /option option value='01' 01/option option value='02'02/option option value='03'03/option option value='04'04/option option value='05'05/option look at your option value=xx. if ( (isset($month)) ($month +0 0) ) { ... Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] verifying that a dropdown was selected
Hello Richard, I'm not quite sure but I think the problem is the following: - If no month has been specified, the variable $month is not defined. - If you then mention $month in if ($month == ) the Parser creates the variable. Its value is unpredictable, but it is most unlikely that it is an empty string (). To solve the problem, you should be able to check whether the variable $month exists. I'm sorry I can't help you here because I've only started programming PHP but reading the function reference or something might help you. Good luck Tom -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net GMX Tipp: Machen Sie Ihr Hobby zu Geld bei unserem Partner 11! http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] verifying that a dropdown was selected
On Thu, Jul 05, 2001 at 12:05:28PM +0200, Tom Gitzinger wrote: Hello Richard, I'm not quite sure but I think the problem is the following: - If no month has been specified, the variable $month is not defined. - If you then mention $month in if ($month == ) the Parser creates the variable. Its value is unpredictable, but it is most unlikely that it is an empty string (). To solve the problem, you should be able to check whether the variable $month exists. I'm sorry I can't help you here because I've only started programming PHP but reading the function reference or something might help you. You could check if it has been set by doing: if (isset($month)) or even if ($month) (I'm not 100% sure about the last one, though..) ad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] verifying that a dropdown was selected
ermshouldnt that be if($month == 00 ) { ? Dave - Original Message - From: Richard Kurth [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Thursday, July 05, 2001 12:35 PM Subject: [PHP] verifying that a dropdown was selected I have a dropdown box that is for selecting the month How can I be verified that the customer has selected one of the months. I am using verification like this but it does not do what I want for a dropdown box it works fine for regular fields if ($month == ) { $month_err = font color=redPlease enter the Month of expiration!/fontbr ; $send = no; select name='month' size='1' option value='00' /option option value='01' 01/option option value='02'02/option option value='03'03/option option value='04'04/option option value='05'05/option Best regards, Richard mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] verifying that a dropdown was selected
select size=1 name=month option value=0 selectedSelect month option value=1January . . . /select . . . if(!$month) { // please select month } else { // month selected } -Original Message- From: Richard Kurth [mailto:[EMAIL PROTECTED]] Sent: 5 iulie 2001 12:36 To: php Subject: [PHP] verifying that a dropdown was selected I have a dropdown box that is for selecting the month How can I be verified that the customer has selected one of the months. I am using verification like this but it does not do what I want for a dropdown box it works fine for regular fields if ($month == ) { $month_err = font color=redPlease enter the Month of expiration!/fontbr ; $send = no; select name='month' size='1' option value='00' /option option value='01' 01/option option value='02'02/option option value='03'03/option option value='04'04/option option value='05'05/option Best regards, Richard mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]