View Full Version : PHP Form: Input effecting another input

07-21-2010, 06:15 PM

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>

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.


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

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??