Hi,
I'm not sure how to call a VB function from a form. I want to generate a random number when a button in a form is clicked. This is what I have so far...
The Function:
<%
Dim MyValue
Function Randomize
upperlimit = 5000000.0
lowerlimit = -300000.0
MyValue =Int((upperlimit - lowerlimit + 1)*Rnd() + lowerlimit)
end function
%>
The Call:
<input type="button" name="generate" value="Generate" onClick="Randomize">
The Output:
<input name="number" type="text" value="<% = MyValue %>" size="15">
What am I missing? I've worked more with javascript than VB and it's been a while since I've worked in VB at all.
Any help would be appreciated. Thanks!
Kris
I'm not sure how to call a VB function from a form. I want to generate a random number when a button in a form is clicked. This is what I have so far...
The Function:
<%
Dim MyValue
Function Randomize
upperlimit = 5000000.0
lowerlimit = -300000.0
MyValue =Int((upperlimit - lowerlimit + 1)*Rnd() + lowerlimit)
end function
%>
The Call:
<input type="button" name="generate" value="Generate" onClick="Randomize">
The Output:
<input name="number" type="text" value="<% = MyValue %>" size="15">
What am I missing? I've worked more with javascript than VB and it's been a while since I've worked in VB at all.
Any help would be appreciated. Thanks!
Kris