[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to send textbox value to next page as a parameter

Posted on 2000-03-21
6
Medium Priority
?
212 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 80 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

834 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