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

how to go to different pages with different buttons? 1

Status
Not open for further replies.

jfdabiri

MIS
Feb 27, 2007
282
US
hi,
i have this page (edit.asp)which has boxes with the data filled in from a previous page. the form name is frm1. it has 4 buttons: (insert, update, delete). i would like to go to different pages when each button is clicked:
when insert button is clicked, it should go to insert.asp
when update button is clicked, it should go to update.asp, etc.
any ideas?
thanks.

 
bigred
thanks so very much. that was the answer that i was looking for all day since 11:00 am this morning. it almost worked. but here's the problem: it does go to different pages on each button, but how do i send the data to that page?
any ideas?
thanks.
 

You mean from the form? Like just a basic ASP form or am I missing something?

First page:

<form method="post" action="name_of_second_page.asp" name="form_name">

<p>
<input name="ident" id="ident" type="text" />
</p>

</form>

Second page:

<%
Dim ident
ident=Request.Form("ident")
Response.Write(ident)
%>





 
thanks bigred.
the form doesn't have "action". the action is on the java as per the article. the java function does the submit. but no data shows up on the new page. maybe i should explain more:
my current page:
edit.asp which has fields filled with data passed from a previous page. these data may have been modified by user.
at the bottom of page are 2 buttons:
"update" and "delete"
i used the method that you posted the link on codeproject. it worked perfect for going to the page i wanted "update.asp", but no data came with it. when i used request.form("field_name"), nothing was there.
any ideas?
thanks

 
the data comes to edit.asp via reading the database and filling the boxes. here's an example of how the boxes are filled:
<INPUT type="text" NAME="email_box" value="<%=email%>">

as you can see, the variables build the value of the input field. could this be the problem?
thanks.
 
bigred,
you deserve a star (maybe more than one). the link that you provided was the best answer i have seen so far. it seems like the whole experts' sites on the internet have never attempted something like this. because they don't know how it's done. i found out how to pass the data:
where it says:
document.Form1.submit();
if you put the form name after submit, like this:
document.Form1.submit(Form1);
it will pass the variables to the next page and can be retrieved using request.form ("field_name")
thanks again.
you're a life saver. i spent the whole sunday and half of today (monday) to make this work.
cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top