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

VBscript -> Javascript

Status
Not open for further replies.

Karl Blessing

Programmer
Feb 25, 2000
2,936
US
is there a way I can perform the same task here, only in JavaScript<br><br><FONT FACE=monospace><br>&lt;Script Language=&quot;VbScript&quot;&gt;<br>&lt;!--<br>&nbsp;sub Go(thePath)<br>&nbsp;&nbsp;DrvFrm.Path.value = thePath<br>&nbsp;&nbsp;DrvFrm.submit<br>&nbsp;end sub<br>--&gt;<br>&lt;/Script&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;Form name=&quot;DrvFrm&quot; action=&quot;default.asp&quot; method=&quot;post&quot;&gt;<br>&nbsp;&lt;input type=&quot;hidden&quot; name=&quot;Path&quot;&gt;<br>&lt;/Form&gt;<br></font> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
<br><br><br>&lt;Script Language=&quot;JavaScript&quot;&gt;<br>&lt;!--<br>&nbsp;function Go(thePath)<br>&nbsp;&nbsp;{DrvFrm.Path.value = thePath;<br>&nbsp;&nbsp;&nbsp;DrvFrm.submit();<br>&nbsp;&nbsp;}<br>--&gt;<br>&lt;/Script&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;Form name=&quot;DrvFrm&quot; action=&quot;default.asp&quot; method=&quot;post&quot;&gt;<br>&nbsp;&lt;input type=&quot;hidden&quot; name=&quot;Path&quot;&gt;<br>&lt;/Form&gt;<br><br>I don't know how you're calling the function, but from wherever that is, just call Go(argument).<br><br>Russ<br>
 
Dear Karl,<br><br>Javascript is not always as nice about type casting for you so depending on how you set the 'path' parameter in the 'Go' function you can sometimes get an error. If you do try this:<br><br>{DrvFrm.Path.value = thePath.toString();<br><br>or if your paranoid like me:<br><br>function Go(thePath){<br>&nbsp;&nbsp;var spath = new String(thePath);<br>&nbsp;&nbsp;DrvFrm.Path.value = spath.toString();<br>...<br>}<br><br>Good luck<br>-pete
 
I just need to be able to change the value of that Input entry, so that when I submit it, I'll be on the next ASP page ready to check Request.Form(&quot;Path&quot;)<br><br>but thanks for both your inputs, I will try them today <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
oh and how I'm calling it<br>is like this<br><br>&lt;TD onclick=&quot;Go('C:\')&quot;&gt; blah blah &lt;/TD&gt;<br><br>only thing is I write ASP , so it'll dynamically put in the values into the HTML tags itself before it returns to the user. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
without the toString seems to work fine. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top