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!

Passing Multiple Arguments to Function

Status
Not open for further replies.

Yesuslave

Programmer
Sep 24, 2003
28
US
Hi all,

Not sure why this code doesn't work, but when I set up multiple arguments in a VBScript Function, it ceases to work. I've tested both arguments individually, and they work find. When in conjunction, though, I get no response. Thanks for the help before hand!

Joshua

<html>
<body>
<script type="text/vbscript">

Sub GetStuf(strFreq,strOrig)
msgbox strFreq
msgbox strOrig
end Sub



</script>
<H1 align="center">Report Lookup Tool</H1>
Please select the type of report you would like to look up from the drop down menu below.<br><br><br><br>
<form>
Frequency:
<select name="Freq">
<option value="Daily">Daily
<option value="Weekly">Weekly
<option value="Bi-Weekly">Bi-Weekly
<option value="Monthly">Monthly
<option value="Other (See Notes)">Other (See Notes)
<option value = "All">All
</select><br>
Originator:
<select name="Orig">
<option value="Amy Williams">N1
<option value="Chris Kerney">N2
<option value="Elizabeth Shoener">N3
<option value="Joshua Wise">N4
<option value="Marge McBride">N5
<option value="Natalie Gerstenbacher">N6
<option value="All">All
</select>
<br>
<input type="button" value="Get List" onclick="GetStuf(Freq.value,Orig.value)">
</form>

</body>
</html>
 
This should work:
Code:
<html>
<body>
<script type="text/vbscript">


Sub GetStuf(strFreq, strOrig)
msgbox strFreq
msgbox strOrig
end Sub



</script>
<H1 align="center">Report Lookup Tool</H1>
Please select the type of report you would like to look up from the drop down menu below.<br><br><br><br>
<form ID=Form1>
Frequency: 
<select name="Freq" ID=Select1>
<option value="Daily">Daily
<option value="Weekly">Weekly
<option value="Bi-Weekly">Bi-Weekly
<option value="Monthly">Monthly
<option value="Other (See Notes)">Other (See Notes)
<option value = "All">All
</select><br>
Originator:
<select name="Orig" ID=Select2>
<option value="Amy Williams">N1
<option value="Chris Kerney">N2
<option value="Elizabeth Shoener">N3
<option value="Joshua Wise">N4
<option value="Marge McBride">N5
<option value="Natalie Gerstenbacher">N6
<option value="All">All
</select>
<br>
<input type="button" value="Get List" onclick="GetStuf[red Select1.value,Select2.value[/red]" ID=Button1>
</form>

</body>
</html>

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Hmmm...that doesn't seem to work. What is the whole [red]...[/red] thing about? as well, there is no closing bracket on the first "red", is that supposed to be that way? I tried it with a closing bracket and without, and neither works.

Thanks,
Joshua
 
Hey, Ok, I'm dumb...lol...

the things you put as [ red ] and [ /red ] appeared in the html, but when I viewed them in my reply, they didn't...so I just took them out of your code, and viola! It works! Thanks very much!
 
Yep...just sloppy typing on my part.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top