PDA

View Full Version : posting data from Form to Server


gaudi8
11-25-2002, 10:06 PM
My challenge is how to write to a database via a Form.

For example, here is the current HTML code for a button from my Form.

<TD colspan=2><input type="button" value="Decline" onclick="apform(this)" style="width: 100%" value2='<%=rs(0)%>' value3='Declined'></TD>

Value2 is the unique identifier (column 0) for the current record. It is used in a Javascript function "apform(this)" in the Form to create a record. The record is posted to an ACCESS database on the server via SQL script also on the Form. Value3 is the data written.

funtion apform(fv)
{
uptrain.appr.value=fv.value3;
uptrain.id.value=fv.value2;
uptrain.submit();
}

where formname.columnname.value

sample SQL:

conn.execute("update table set column="something" where id= "&request.form("id")


I can't figure out how to define value3 for a textbox on the form.

<TD colspan=2><input type="text" value="Comments" onclick="apform(this)" style="width: 100%" value2='<%=rs(0)%>' value3='???????'></TD>

whammy
11-26-2002, 01:43 AM
You should repost your question in the ASP forum, where I think it belongs... or perhaps a moderator will move it. :)

You shouldn't use javascript to create a record either... how 'bout you post what the problem is in the ASP forum? :)

gaudi8
12-02-2002, 05:28 PM
thanks for reviewing my post. I will try the asp forum as you suggest.