Jump to content

subform for register children!


stijn0713

Recommended Posts

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!

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.