Jump to content

PHP and List Box Help!!!!


gagards200

Recommended Posts

hello guys I am a newbies in php and I need your kind help...

 

The syntax below will output a 12 listbox...what I want is I will add one listbox for the user option.. It means:

 

If user will select 1 - it will show only 1 listbox instead of 12

If user will select 2 - it will show only 2 listbox instead of 12

If user will select 3 - it will show only 3 listbox instead of 12

If user will select 4 - it will show only 4 listbox instead of 12

...........so on and so forth...

 

Can anyone help me guys?

 

 

 

 

 

 

 

<select name="ppm_sched1">

 

<option>2011</option>

<option>2012</option>

<option>2013</option>

<option>2014</option>

<option>2015</option>

<option>2016</option></select>

<select name="ppm_sched2">

 

<option>01</option>

<option>02</option>

<option>03</option>

<option>04</option>

<option>05</option>

<option>06</option>

<option>07</option>

<option>08</option>

<option>09</option>

<option>10</option>

<option>11</option>

<option>12</option></select>

 

 

<font face="Arial" size="2">        6.</font>

 

<select name="ppm_sched3">

 

<option>2011</option>

<option>2012</option>

<option>2013</option>

<option>2014</option>

<option>2015</option>

<option>2016</option></select>

<select name="ppm_sched4">

 

<option>01</option>

<option>02</option>

<option>03</option>

<option>04</option>

<option>05</option>

<option>06</option>

<option>07</option>

<option>08</option>

<option>09</option>

<option>10</option>

<option>11</option>

<option>12</option></select>

 

</td>

 

</tr>

<tr>

<td bgcolor="lightblue" align="right"><font face="Arial" size="2">2.</font></td>

<td bgcolor="pink">

<select name="ppm_sched5">

 

<option>2011</option>

<option>2012</option>

<option>2013</option>

<option>2014</option>

<option>2015</option>

<option>2016</option></select>

<select name="ppm_sched6">

 

<option>01</option>

<option>02</option>

<option>03</option>

<option>04</option>

<option>05</option>

<option>06</option>

<option>07</option>

<option>08</option>

<option>09</option>

<option>10</option>

<option>11</option>

<option>12</option></select>

 

 

<font face="Arial" size="2">        7.</font>

 

<select name="ppm_sched7">

 

<option>2011</option>

<option>2012</option>

<option>2013</option>

<option>2014</option>

<option>2015</option>

<option>2016</option></select>

<select name="ppm_sched8">

 

<option>01</option>

<option>02</option>

<option>03</option>

<option>04</option>

<option>05</option>

<option>06</option>

<option>07</option>

<option>08</option>

<option>09</option>

<option>10</option>

<option>11</option>

<option>12</option></select>

 

</td>

 

</tr>

<tr>

<td bgcolor="lightblue" align="right"><font face="Arial" size="2">3.</font></td>

<td bgcolor="pink">

<select name="ppm_sched9">

 

<option>2011</option>

<option>2012</option>

<option>2013</option>

<option>2014</option>

<option>2015</option>

<option>2016</option></select>

<select name="ppm_sched10">

 

<option>01</option>

<option>02</option>

<option>03</option>

<option>04</option>

<option>05</option>

<option>06</option>

<option>07</option>

<option>08</option>

<option>09</option>

<option>10</option>

<option>11</option>

<option>12</option></select>

 

 

<font face="Arial" size="2">        8.</font>

 

<select name="ppm_sched11">

 

<option>2011</option>

<option>2012</option>

<option>2013</option>

<option>2014</option>

<option>2015</option>

<option>2016</option></select>

<select name="ppm_sched12">

 

<option>01</option>

<option>02</option>

<option>03</option>

<option>04</option>

<option>05</option>

<option>06</option>

<option>07</option>

<option>08</option>

<option>09</option>

<option>10</option>

<option>11</option>

<option>12</option></select>

 

</td>

 

Link to comment
https://forums.phpfreaks.com/topic/232759-php-and-list-box-help/
Share on other sites

You need to provide more information. You don't say HOW the user will select how many fields to display. Is the user going to make a selection and submit a form or are you expecting this to happen dynamically? If the latter, then you need JavaScript and you have posted this in the wrong forum.

 

I'm also a little confused by the code you posted. It seems you are alternating back and forth between a select field for year and another for month. So, if the user selects "3" do you want to show two year selections and one month selection or do you want to show three "sets" of year and month selections? I would think the latter, but your naming convention of the fields is odd.

His Sir thanks for your response, but first i apologized because you are right that this needs javascript..because i want this happen dynamically..could you give me any links or simple tutorials, suggestions to do this? you are right that if the user will input 3 it will display 3 sets of year, month and day...waiting your positive reply.....

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.