Click to See Complete Forum and Search --> : javascript/vbscript?


rosenzl
03-10-2003, 12:58 PM
I am trying to call a javascript function called getthedate. It's being called by vbscript code as follows:

<%
dim todaydate
todaydate = getthedate(0)
%>

This yields me a "type mismatch". If I put the above code in javascript tags, I don't get the error, but I need the returned value in the following code, but it never gets there due to being inside the javascript tags:

<!--webbot bot="Validation" s-display-name="Choose" b-disallow-first-item="TRUE" --><Select Name="thedates">
<option name="-choose-" value="-choose-" <% if thedates = "-choose-" then response.write "selected" end if%>>-choose-</option>
<option name="Pickup" value="<%=todaydate%>" <% if thedates = " & todaydate &" then response.write "selected" end if %>><%= todaydate %></option>
<option name="Delivery" value="<%=tomdate%>" <% if thedates = " & tomdate &" then response.write "selected" end if %>><%= tomdate %></option>

How can I get the returned value into the above code????

Thanks

AdamBrill
03-10-2003, 01:20 PM
The code that you posted looks like ASP, not VBScript. I don't think you can call a javascript function from ASP. ASP is server-side, so it runs before the javascript starts...

rosenzl
03-10-2003, 01:27 PM
What other method can I use to call the function and get the returned date into the code below? Specifically, TODAYDATE.

<!--webbot bot="Validation" s-display-name="Choose" b-disallow-first-item="TRUE" --><Select Name="thedates">
<option name="-choose-" value="-choose-" <% if thedates = "-choose-" then response.write "selected" end if%>>-choose-</option>
<option name="Pickup" value="<%=todaydate%>" <% if thedates = " & todaydate &" then response.write "selected" end if %>><%= todaydate %></option>
<option name="Delivery" value="<%=tomdate%>" <% if thedates = " & tomdate &" then response.write "selected" end if %>><%= tomdate %></option>

AdamBrill
03-10-2003, 01:33 PM
Well, I don't know how to get the date in ASP. I'm sorry... :( I know how to get it in PHP, but that probably doesn't help you much. :) There is a ASP section of this forums... Maybe you could try posting your question there.

khaki
03-10-2003, 06:44 PM
rosenzl...
I see that you have posted this same question all over the place in the different forums here (I even responded to one of them), so I'm not responding to you here in this one.

however....
Adam....
AdamBrill wrote: The code that you posted looks like ASP, not VBScript.
ASP is not a language.
VBScript is a language.
What you are looking at when you see ASP, are actually what are called ASP delimiters. A great deal of the code within those delimiters is hard-core VBScript.
Just so you know (luv ya sweetie!).

another button pushed (but handled quite delicately... I hope! wink)...
k

AdamBrill
03-10-2003, 06:54 PM
Originally posted by khaki
ASP is not a language.
VBScript is a language.
What you are looking at when you see ASP, are actually what are called ASP delimiters. A great deal of the code within those delimiters is hard-core VBScript.
Just so you know (love ya sweetie!).

another button pushed (but handled quite delicately... I hope! wink)...
k Ok, I get it... :D I never even tried to learn ASP or looked at it long enough to know anything about it, so... ;) PHP just looked sooooo much easier that I learned/am learning that instead. I don't know if PHP is really easier, but it looked like it to me. :) If you ever find someone that knows both, ask them for me... lol :D