Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

request.url

Status
Not open for further replies.

marianmarian

Programmer
Jan 17, 2003
40
CA
hi there,

i am trying to request an id from a url like this:


can i do this in javascript, and if so how? and if it is possible can i pass that id in my existing html document url to be submitted to the next page.

so basically when i get the id from the url, i would like to pass it to a url in that present html document.

thanks for all your responses.
 
each time i try to use request.querystring in javascript in my .aspx page, each time i run the query i get "Request is undefined" can someone tell me what i am doing wrong?
<SCRIPT language=javascript>
Request.QueryString("MTID");
</SCRIPT>
thanks,
marianmarian
 

Try using "location.search". For an example, "alert(location.search);" on your page.

Hope this helps,
Dan
 
yup, then u have to split it at & an read the values one by one...

Known is handfull, Unknown is worldfull
 
thanks for all your responses, it works fine, but now here is my next question, how do i pass the id to my href link in my form?

here is what i have done so far:
<script jscript>
var id=location.search
var id2=id.split("&")
myID=id2[1]
</script>

<form>
<table>
<a href="somewebsite.com?id="myID>mylink</a>
</table>
</form>

thanks for all your responses
 
thanks to you all, i was able to do whatever i wanted to do.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top