Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add data dynamically

Status
Not open for further replies.

ShubhaMishra

Programmer
Jan 4, 2007
10
IN
I am creating a prototype for new application. And I have to add new fields on into the same page if radio button is set as Yes.
For Example -

On one jsp page these are 2 fields for Experience

1- Name of Company - Text Field
2- Years of Experince - Text Field


3- Do you have any other experience - Radio button (Yes, No)

If the person says clicked on Yes one more copy of fields( 1 & 2) should be available on the same page.

I am not sure its possible in DreamWeaver or not. If its possible can you please let me know How can we do that .My pages are in JSP

Thanks,
Shubha
 
You'll have to use Javascript to dynamically add the fields. You could potentially have a hidden div that contains 2 or more sets of the field sets. And then using the OnClick event of the radio button, change the display attribute of the DIV to visible.


Code:
<input type=radio name="yesno" value="yes" OnClick="document.morediv.display=block;">
<input type=radio name="yesno" value="no" OnClick="document.morediv.display=none;">

Code:
#more{
[green]\\style div as you would like it to appear. but set display to none so it is hidden by default.[/green]
...
display:none;
}
<div id="more">
[green]1- Name of Company                  - Text Field
2- Years of Experince               - Text Field[/green]
</div>

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top