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

Passing values from one form to another form

Status
Not open for further replies.

Ciarrai

Technical User
Jun 27, 2003
17
US
I'm getting errors passing values from one form to another. I'd be glad if anybody could point out what I'm doing wrong..
I'm passing 'headline' to the second form and I've tried to use input type = 'hidden' to capture the value and send it to my asp page where I am sending the values to my database.

Here's the First Form:
<form action = "createBasic.asp" method = "post">
<input type="text" name="headline">
</form>

Here's the Second Form:
<form name = "theForm" method = "post" action = "createBasic.asp" enctype="multipart/form-data">
<input type="hidden" name="headline" value="<%=Request.Form("headline")%>">
<input type="submit" value="Preview" >
</form>

Thank you for any help..
 
In your first form, I do not see where you are setting a value for headline. If you have not set a value, how can you pass anything to the second form?

Also, I assume that you are sending your data via the form post, yes?

-----------------------------------------------------------------------------------------------------
"If you can't explain something to a six-year-old, you really don't understand it yourself."
-- Albert Einstein
 
Thank you for your replies. I realised I needed to set the value in form one so I gave the form a name(theFrm) and used a javascript function to set the value and pass it to form 2(theForm).

<script language = "javascript">
function getValue()
{
var header=window.document.theFrm.headline.value;
window.document.theForm.headline.value = header;
{
</script>

Ciarrai
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top