Hello everyone,
I'm trying to combine 3 form input fields into 1 that is hidden (Date of Birth). The input fields are DOB-MM, DOB-DD, and DOB-YYYY and the hidden field is DOB which will store the Date of Birth in the following format 'YYYY-MM-DD'. Unfortunately I don't know javascript so I hope someone can help me write a quick script that will combine these 3 fields and arrange them in the format required.
Thank you in advance!
Cheers!
<form name="signup" action="{{{form_url}}}" class="appnitro" method="post" >
<div class="form_description">
<h2>Newsletter Sign-up</h2>
</div>
<ul >
<li id="li_1" >
<label class="description" for="person_name">Name / Nombre </label>
<span>
<input id="person_first_name" name= "person[first_name]" class="element text" maxlength="255" size="20" value="{{{first_name}}}"/>
<label>First Name / Nombre</label>
</span>
<span>
<input id="person_last_name" name= "person[last_name]" class="element text" maxlength="255" size="20" value="{{{last_name}}}"/>
<label>Last Name / Apellido</label>
</span> </li> <li id="li_3" >
<label class="description" for="person_email_address">Email / Correo Electronico * (Required)</label>
<div>
<input id="person_email_address" name="person[email_address]" class="element text medium" type="text" maxlength="255" value="{{{email_address}}}"/>
</div>
</li> <li id="li_4" >
<label class="description" for="person_dob">Date of Birth / Fecha de Nacimiento </label>
<span>
<input id="person_dobmm" name="person[dobmm]" class="element text" size="2" maxlength="2" value="{{{dobmm}}}" type="text"> /
<label for="DOB-MM">MM</label>
</span>
<span>
<input id="person_dobdd" name="person[dobdd]" class="element text" size="2" maxlength="2" value="{{{dobdd}}}" type="text"> /
<label for="DOB-DD">DD</label>
</span>
<span>
<input id="person_dobyyyy" name="person[dobyyyy]" class="element text" size="4" maxlength="4" value="{{{dobyyyy}}}" type="text">
<label for="DOB-YYYY">YYYY</label>
</span>
<input id="person_dob" name="person[dob]" start_year="1910" type="hidden" value="{{{dob}}}" />
</li>
<li class="buttons">
<input class="button_text" type="submit" name="commit" value="Sign Up" />
</li>
</ul>
</form>