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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read URL parameters using VBScript

Status
Not open for further replies.

banbuzz

Programmer
Jul 16, 2007
3
GB
Can anyone suggest me how to read parameters from the url using Vbscript

i have a form having 3 fields and on submit i am recalling the same webpage with text box values passed as url parameters .

i want to read these url parameter using Vb script so that i can call my sub procedure written in vbscript depending on the form values passed in url.

Please send ur replies ASAP
 
Start with
[tt] s=window.location.search[/tt]
and parse out the parameters.
 
Can you please elaborate more on this ..as i have no previous experience of working with Vbscript..
so it will be helpful if u can provide me the code or any online material .
 
[tt]<html>
<head>
<title>Submit to itself for testing</title>
<script language="vbscript">
sub getxy
dim s,a,t,a2
s=window.location.search
if len(s)<>0 then
s=right(s,len(s)-1)
a=split(s,"&")
for i=0 to 1
a2=split(a(i),"=")
document.getElementById("coord" & i).innerHTML="name: " & a2(0) & "; value: " & a2(1)
next
end if
end sub
</script>
</head>
<body onload="getxy()">
<div>Click on different places of the image to test results</div>
<form name="formname" action=""> <!-- submit to itself -->
<input type="image" src=" style="width:160px;height:120px;" alt="submit-image" /><br />
</form>
<div id="coord0"></div>
<div id="coord1"></div>
</body>
</html>[/tt]
 
Thanku for ur help.

Well i tried this with my code and i am able to fetch the url parameters ..

Well what exactly i want to do is when user enters the parameters i search through an excel file using vbscript where search criteria is user input.
but now when i am trying to print results of my search by creating a html table in div using the command u have written . it does n't show the table ...

.. any thing u can help me with
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top