below is the code for my form handler (or form update) that updates
1 table in my database.
my problems is if i make a dynamic form with fields from 1 or more tables
then the form handler dosent work. i have tried to modify it but to no
avail. if anyone knows how to populate mor than 1 table in a database form
one form handler it would be much appreciated thanks
<%@ Language=JavaScript %>
<!-- #include file="ch4_include.asp" -->
<%
temp_update = "";
for ( field_number = 1; field_number <= Request.QueryString.count ;
field_number++ )
{
temp_field = String(Request.QueryString.Key(field_number));
temp_content = String(Request.QueryString.item(temp_field))
// make sure field is one we want to use
//if (temp_field.search(/co_|toss|current_/) < 0 ){
if (temp_field.search
(/current_milestone|current_project|toss/) < 0 ){
// nulls
if (temp_content == "null" || temp_content == "")
{
temp_update += " "+ temp_field + " = null,";
}
//int fields
else if (temp_field.search(/MilestoneID/) >= 0)
{temp_update += " "+ temp_field + " = " +
temp_content +",";}
//this works for non-null char fields
else
{
temp_content = temp_content.replace(/'/g,"'");
temp_update += " "+ temp_field + " = '" +
temp_content +"',";
}
} // end if we want to use field
} // end for loop
// remove last character, which is a trailing comma that we don't want
temp_update = temp_update.substring(0,temp_update.length-1);
update_sql = "update Milestone set " + temp_update + " where MilestoneID
= " + current_milestone ;
Conn.Execute(update_sql);
Conn.Close ();
%>
<%
//Response.Redirect(list_subcategory_script + "?current_programme=" +
current_programme)
//Response.Redirect(list_subcategory_script + "?current_milestone=" +
current_milestone)
//Response.Write("<hr>\n\n\n" + update_sql + "\n\n\n<hr>");
//Response.Write(list_subcategory_script + "?current_milestone=" +
current_milestone)
%>