Solved

how to send textbox value to next page as a parameter

Posted on 2000-03-21
6
204 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
ID: 2643250
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
ID: 2643257
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
ID: 2643348
And I:
<input id="txtField1">
<a href="delete.asp" onclick="window.open(this.href+'?value='+escape(txtField1.value), '_self'); return false;">submit</a>
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:sandeeptyagi
ID: 2643836
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
ID: 2644237
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
ID: 2647896
FRehman

ur code has worked this time.

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Pass through dll 2 91
SQL to update characters in table column 6 143
ASP CDO - Limiting Connections 3 59
Diminish Pop-up  in 3 seconds 7 44
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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

789 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