PDA

View Full Version : PHP Form: Input effecting another input


J_mo
07-21-2010, 06:15 PM
Hi,

I am not very clued up on PHP so bare with me.

I have created a form in which I have this dropdown:

<select name="Payfreq" id="Payfreq">
<option selected>please select...</option>
<option>Last Friday of the Month</option>
<option>Last Thursday of the Month</option>
<option>Last Wednesday of the Month</option>
etc
</select>

and following that an input:

<input type="text" name="Payday" id="Payday">

Is there any PHP I can use that would populate my Payday input depending on the option selected in my Payfreq dropdown, obviously in the form of the next pay date...ie 26/7/2010 etc

I hope I explained that correctly.

Thanks
Phil

edbr
07-22-2010, 02:31 AM
not completely im feeling a bit dense this morning. are you getting values form a database? if not it i think a javascript solution may be better

J_mo
07-22-2010, 11:45 AM
Ok, I will try and explain.

I would like the next payday calculated and put into a text input depending on what is chosen from a drop down list.

ie. If "payed on the last friday of every month" is selected from the drop down then the relevant date would appear in the next payday input in this format: 30/7/2010

Is that better??

Phil