Hello,
I'm trying to write a VBscript function to popup some value from clients side but I it doesn't work.
Here is my code:
<%While Not RS.EOF %>
<form name="form1" method="post" action="nextpage">
<table>
<tr><td>Price:<input type="text" name="price" value="<%=RS("price"
%>">
</td></tr>
<tr><td>Number of items:
<select name="NumItems" size=1>
<option value="1">1</option>
<option value="1">1</option>
<option value="1">1</option>
</select>
</td></tr>
<tr><td>
<input type="button" name="btn1" value="Add to cart" onClick="Call Add2Cart">
</td></tr>
<tr><td><input type="submit" value="submit"></td></tr>
</table>
</form>
<%
RS.MoveNext
WEND
%>
<script language="vbscript">
Function Add2Cart
document.form2.F2price.value = document.form1.price.value
document.form2.F2Items.value = document.form1.NumItems.value
End Function
</scrip>
<form name="form2">
<input type="text" name="F2price">
<input type="text" name="F2Items">
</form>
While not end of file when the "Add to cart" button is clicked, the values of textbox in form2 are set to values of those in form 1.
Can someone please help me out? I got the error "obj doesn't support this property or method" in line
document.form2.F2price.value = document.form1.price.value
Thanks in advance.
I'm trying to write a VBscript function to popup some value from clients side but I it doesn't work.
Here is my code:
<%While Not RS.EOF %>
<form name="form1" method="post" action="nextpage">
<table>
<tr><td>Price:<input type="text" name="price" value="<%=RS("price"
</td></tr>
<tr><td>Number of items:
<select name="NumItems" size=1>
<option value="1">1</option>
<option value="1">1</option>
<option value="1">1</option>
</select>
</td></tr>
<tr><td>
<input type="button" name="btn1" value="Add to cart" onClick="Call Add2Cart">
</td></tr>
<tr><td><input type="submit" value="submit"></td></tr>
</table>
</form>
<%
RS.MoveNext
WEND
%>
<script language="vbscript">
Function Add2Cart
document.form2.F2price.value = document.form1.price.value
document.form2.F2Items.value = document.form1.NumItems.value
End Function
</scrip>
<form name="form2">
<input type="text" name="F2price">
<input type="text" name="F2Items">
</form>
While not end of file when the "Add to cart" button is clicked, the values of textbox in form2 are set to values of those in form 1.
Can someone please help me out? I got the error "obj doesn't support this property or method" in line
document.form2.F2price.value = document.form1.price.value
Thanks in advance.