Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I need to get url from address bar for the current page and put it into textbox .

What I have tried:

I tried alot of things but nothing goes right
Posted
Updated 8-May-16 6:12am
Comments
Sergey Alexandrovich Kryukov 8-May-16 12:33pm    
Read carefully:
What have you tried so far?

—SA

1 solution

In JavaScript/jQuery you can code similar to:

JavaScript
$(document).ready(function() {
   var url = window.location.href;
   $('#textboxid').val(url);
});
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 8-May-16 12:35pm    
5ed.
(No need to use jQuery though; and you should have mentioned that it's jQuery or anything like that.)
—SA
P_Z 8-May-16 12:45pm    
Thanks for the suggestion, you're right in that solution used jQuery
Sarah Mohammed77 8-May-16 13:01pm    
thank you so much that's exactly what I need .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900