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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form inside a Form

Status
Not open for further replies.

arundahar

Programmer
Apr 27, 2001
53
GB
I have a normal form that submits to a confirmation page, inside this i have a Drop-down selection that Onchange refreshes the same page, when something is selected i need to display the choice in the drop-down but keep the other selections so they can change their mind. How can i do this without submitting the overall form to the confirmation page?
 
You can't refresh the page and keep the form elements the same, at least not the way you're doing it.

There are multiple ways to do this;
1) Use javascript to hold all the possible information needed, and dynamically fill in the boxes that way. Since I think that you may be filling in the boxes from DB info that changes with onChange, this might not be your best bet.

2) have a hidden form at the bottom of your page, and store all hidden fields down there. When the user does an onchange, populate the hidden fields (using javascript), then trigger the form (document.myform.submit();). make sure the form points to itself (ie action="form.asp"), then, with the ASP code populate the form that way.

I hope this made sense to you... I'm not even sure if it made sense to me :)

If you need an example, I'll be more than happy to post one up.

hth
leo leo
 
No i don't need to keep all the data, and no i'm not using a database.
Example:
First Page name = index.asp

<form action=&quot;pagehandler.asp&quot; method=&quot;post&quot;>

<select onchange=&quot;submitForm()&quot;>
<option>blah</option>
<option>dfkj</option>
</select>

<a href=&quot;javascript:submitForm()><image></a>

When an option is selected from the drop-down i want it to reload the index.asp page (the first page) and NOT go straight to the pagehandler.asp page. So i need a second form around the select to just &quot;refresh&quot; the page back onto itself.. But how?

Arun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top