Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 18, 2012 04:23 PM by usman400
0 Points
9 Posts
Dec 18, 2012 08:47 AM|LINK
Please tell us how can we retrieve a TEXT Field data in ASP page dynamically into the the Link on the same page ,
so when the link is clicked it should forwarded with the text field data in it
Contributor
3832 Points
651 Posts
Dec 18, 2012 09:07 AM|LINK
You can achieve that with jQuery
$(document).ready(function(){ $('#link').click(function(event){ window.location = 'http://www.yoursite.com?' + $("#TextBoxID").val(); event.preventDefault(); }); });
3513 Points
721 Posts
Dec 18, 2012 09:11 AM|LINK
Put a link button on page, double click it and right following (textBox1 is the id of your text box control):
Response.Redirect("http://www.google.com/" + textBox1.Text);
Dec 18, 2012 02:41 PM|LINK
Hi ,thanks for the solution , But can we achieve this in normal JavaScript code ? Its is a plain asp page .
Please let me know this.
Dec 18, 2012 04:23 PM|LINK
Here is a complete little code
<html> <body> <input type="text" value="abc" id="txtUrl"/> <a href="" onClick="VisitNow();">Click to Visit</a> <script> function VisitNow() { var txt = document.getElementById('txtUrl').value; window.open('http://www.google.com/' + txt, '',200,100); } </script> </body> </html>
Santosh-iWeb
0 Points
9 Posts
Retrieving a TEXT Field data in ASP page dynamically into the the Link
Dec 18, 2012 08:47 AM|LINK
Please tell us how can we retrieve a TEXT Field data in ASP page dynamically into the the Link on the same page ,
so when the link is clicked it should forwarded with the text field data in it
senthilwaits
Contributor
3832 Points
651 Posts
Re: Retrieving a TEXT Field data in ASP page dynamically into the the Link
Dec 18, 2012 09:07 AM|LINK
You can achieve that with jQuery
$(document).ready(function(){ $('#link').click(function(event){ window.location = 'http://www.yoursite.com?' + $("#TextBoxID").val(); event.preventDefault(); }); });Senthil Kumar Sundaram
usman400
Contributor
3513 Points
721 Posts
Re: Retrieving a TEXT Field data in ASP page dynamically into the the Link
Dec 18, 2012 09:11 AM|LINK
Put a link button on page, double click it and right following (textBox1 is the id of your text box control):
Response.Redirect("http://www.google.com/" + textBox1.Text);Santosh-iWeb
0 Points
9 Posts
Re: Retrieving a TEXT Field data in ASP page dynamically into the the Link
Dec 18, 2012 02:41 PM|LINK
Hi ,thanks for the solution , But can we achieve this in normal JavaScript code ? Its is a plain asp page .
Please let me know this.
usman400
Contributor
3513 Points
721 Posts
Re: Retrieving a TEXT Field data in ASP page dynamically into the the Link
Dec 18, 2012 04:23 PM|LINK
Here is a complete little code
<html> <body> <input type="text" value="abc" id="txtUrl"/> <a href="" onClick="VisitNow();">Click to Visit</a> <script> function VisitNow() { var txt = document.getElementById('txtUrl').value; window.open('http://www.google.com/' + txt, '',200,100); } </script> </body> </html>