Click to See Complete Forum and Search --> : Assign a form value to an ASP variable


edwardpaul
01-12-2006, 02:56 PM
First forgive me of any ignorances I display as far as coding go!
What I am trying to do is place a form value during an onChange event to an ASP variable... Here is the code I'll try to explain

Take the first part, assign it to "temp" then submit that value in the address.
Thanks for the help!


%>
</select> </td>
<td ><select name="select2" class="select-type1" onChange="form1.txtChild.value=form1.select2[form1.select2.selectedIndex].text">
<option selected="selected">Please Select</option>
</select></td>

<td> <input name="txtChild" type="text" class="formField" id="txtChild" value="" size="25" /></td>
</tr>
<tr>
<% Temp = 1 %>

<script type="text/javascript" language="JavaScript">

function ActionDeterminator()
{
document.form1.action = 'cart.asp?action=add&item=<%= Temp %>&count=1';}

lmf232s
01-13-2006, 02:16 PM
edwardpaul,
You can not assign an asp variable a value until the page is submitted.

Once the page is submitted then its as easy as this

Dim myASPVariable
myASPVariable = Request.form("txtChild")

Where txtChild is the name of the form element your trying to retreive the value of.

Does that help?

Bullschmidt
01-15-2006, 09:03 PM
And for a somewhat related link:

Classic ASP Design Tips - Post Back Page
http://www.bullschmidt.com/devtip-postbackpage.asp