stijn0713 Posted February 25, 2012 Share Posted February 25, 2012 in a table cell i have a select statement with options from 1 to 10. Onchange (if they select 3), i want to display a subform in the same table cell where the person can add the for the three children name (Textfield) sex (select: M/F) date of birth (select for day, select for month and select for year) currently, i've tried something with javascript but it's only saves the child_id and parent_id and does not save the rest. Moreover i have no clue how to populate the date of birth. Please if you have any solutions, tell me! Any help is very much appreciated! Quote Link to comment Share on other sites More sharing options...
sunfighter Posted February 25, 2012 Share Posted February 25, 2012 From reading i want to display a subform in the same table cell I deduce that you have a form; in that form you show and potion your elements by using a table; one table cell has a dropdown labeled 'enter number of children' or some thing like that and when the number is chosen you want to expand this cell to have a number of additions to the form. I would like to see the code for the form and the css for it also. Needed to figure out how to expand the cell. But you are going to add something like this per child : <fieldset> <legend>Data on Children</legend> Child's Name <input type="text" maxlength="24" name="child_name_1" /><br /> sex (select: M/F)<span style="background-color: #89CFF0"> Male <input type="radio" name="sex_1" value="M" /></span><span style="background-color:pink"> Female <input type="radio" name="sex_1" value="F" /></span><br /> Date of Birth <input type="date" max="2012-02-25" step="1" required="required" name="special_1" /> </fieldset> Get the date of birth thing from google here http://code.google.com/p/input-type-date/downloads/detail?name=input-type-date-1.0.3.zip This has to be done in javascript, not php. Also notice the '_1' (there is a lot of em) this has to be increased for each child. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.