Solved

how to send textbox value to next page as a parameter

Posted on 2000-03-21
6
202 Views
Last Modified: 2008-01-09
I have got three asp pages , search.asp, update.asp and delete.asp search page has got a form (name of form is form1 and it contains just one textbox "id" and a submit button whose action is update.asp so the submit button takes me to update page where i can do the updation using request.form("id") in my sql command.

now there is also hyperlink on the search.asp which whould lead me to delete.asp, i think i need to explicitly pass the value of "id"'s value in <a> tag using ?. i tried it but couldn,t pass the value.

now the questions are:
1. is it possible to send variables using <a> tag, if yes then how?
2. is there some other method to acheive my goal like instead of using submit button/ hyperlink , should i use response.redirect method (which i had tried actually without any success)

Thanks in advance
sandeep


0
Comment
Question by:sandeeptyagi
6 Comments
 
LVL 2

Expert Comment

by:anupvijay
Comment Utility
Hi sandeeptyagi
yes you can pass values to the  next page using the <A> tag
It is something like given below
<A href="delete.asp?varname1=xyz&varname2=abc">link</A>
Where
varname1 will be the variable you will be passing value in and xyz is the value of that variable.
To reteive this in the delete.asp
You can do the following
x=Request.Querystring("varname1")
y=Request.Querystring("varname2")
There you are.....
Tell me if this is working or not ,It should as i am dong my work through this only
About the response.redirect method also you can do the same sort of thing
Response.Redirect "delete.asp?varname1=xyz&varname2=abc"
and same method can be used to retrive data.
All the best
0
 
LVL 4

Accepted Solution

by:
FRehman earned 20 total points
Comment Utility
simple
<html>
<head>
<script language="Javescript">
 function test()
{
document.form1.action="update.asp"
document.form1.submit();
}
</script>
</head>
<HTML>
<BODY>
<FORM name=form1 method=post>
<input type="text" name="T1">
<a href="Javascript=test()">click it</a>
</form>
</body>
</html>
in update page you write it
<%
response.write(request.form("T1"))
%>
by clicking the tag the form will submit and you can get the textbox value on other page
you can also get the value of textbox byu sending it in to querystring method
0
 
LVL 10

Expert Comment

by:Yury_Delendik
Comment Utility
And I:
<input id="txtField1">
<a href="delete.asp" onclick="window.open(this.href+'?value='+escape(txtField1.value), '_self'); return false;">submit</a>
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:sandeeptyagi
Comment Utility
anupvijay

abc and xyz are not fixed value but textbox's values. and could be
just anything under the sun.so i cant' write varname1=abc

FRehman

HTTP Error 404
404 Not Found

this is what i got when clicked the hyperlink. perhaps u have mistyped
the syntax of <a> tag. if so please check it out.

 Yury_Delendik
ur code did open a new window but couldn't get me the value.
may be u too mistyped something. so please look at ur code once again.

sandeep
0
 
LVL 4

Expert Comment

by:FRehman
Comment Utility
sorry for little mistake now I check it and it run in my computer well if you find any problem then let me know at leo_faisal@yahoo.com
<html>
<head>
<script language="Javascript">
 function test()
{
alert("dfg")
document.form1.action="update.asp"
document.form1.submit();
}
</script>
</head>
<HTML>
<BODY>
<FORM name=form1 method=post>
<input type="text" name="T1">
<a href="Javascript:test()">click it</a>
</form>
</body>
</html>
0
 

Author Comment

by:sandeeptyagi
Comment Utility
FRehman

ur code has worked this time.

my thanx to you .
see u with some other question later
 
sandeep
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now