Welcome Guest, Not a member yet? Register   Sign In
form_dropdown() with set_select()
#1

[eluser]Unknown[/eluser]
I read this topic regarding using form_dropdown() with set_select(), but it doesn't seem to be working for me.

I am doing a simple Month-DD-YYYY dropdown combination to accept a person's age.

Code:
//set month array
$months=array(0=>"---------",1=>"January",2=>"February",3=>"March",4=>"April",5=>"May",6=>"June",7=>"July",8=>"August",
              9=>"September",10=>"October",11=>"November",12=>"December");
//set days array
$days=array(0=>"--");
for ($i=1;$i<=31;$i++)
    $days[$i]=$i;

//set years array            
$years=array(0=>"----");

for ($i=2007;$i>=1940;$i--){
    $years[$i]=$i;
}

so, setting dropdowns:
Code:
<p>Enter your date of Birth:</p>
<div style="float:left">Month:<br>&lt;?=form_dropdown('month',$months)?&gt;</div>
<div style="float:left">Day:<br>&lt;?=form_dropdown('day',$days)?&gt;</div>
<div style="float:left">Year:<br>&lt;?=form_dropdown('year',$years)?&gt;</div>

now for the validation set_select(), from the docs in the User's Guide, I must have access to the <OPTION> tags. I don't see how to get to those while using the form helper functions. It seems to me that I must choose one or the other.

Certainly there's a way to smoothly use these in conjunction?


Messages In This Thread
form_dropdown() with set_select() - by El Forum - 07-11-2007, 12:56 PM
form_dropdown() with set_select() - by El Forum - 07-16-2007, 03:14 PM
form_dropdown() with set_select() - by El Forum - 07-16-2007, 03:52 PM
form_dropdown() with set_select() - by El Forum - 07-17-2007, 02:36 AM
form_dropdown() with set_select() - by El Forum - 08-06-2010, 04:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB