G
Guest
Hi, I'm sure this is a standard thing. I have a web form with several input
boxes/drop down lists and checkboxes. They all represent a field within a sql
table and I need the user to update the values on hitting submit. I have put
a submit button on the form and tested it with one field, so in the submit
code I opened a sql connection and did an UPDATE mytable SET fieldintable =
inputonwebform.text where customerid=x.
This worked! However, it just so happened that I changed the value in
'fieldontable'. Should I be creating an update statement for EVERY field on
my form, even though the user may only change one or two values at a time? I
know there is a OnTextChanged event handler of a text box, so i could capture
whether it has been changed or not (and then have to handle the drop
downs/checkboxes too presumbably using a different handler), but how can I
maintain a list of controls whose values have changed up until the point
where the user hits submit. Looking for the best practice to do this. dont
want to start keeping a comma seperated value in a hidden field, I find that
really messy. I am sure there is a really good way to do this as this seems
to be the power of web forms, I just need someone to tell me it!!!
Many thanks.
boxes/drop down lists and checkboxes. They all represent a field within a sql
table and I need the user to update the values on hitting submit. I have put
a submit button on the form and tested it with one field, so in the submit
code I opened a sql connection and did an UPDATE mytable SET fieldintable =
inputonwebform.text where customerid=x.
This worked! However, it just so happened that I changed the value in
'fieldontable'. Should I be creating an update statement for EVERY field on
my form, even though the user may only change one or two values at a time? I
know there is a OnTextChanged event handler of a text box, so i could capture
whether it has been changed or not (and then have to handle the drop
downs/checkboxes too presumbably using a different handler), but how can I
maintain a list of controls whose values have changed up until the point
where the user hits submit. Looking for the best practice to do this. dont
want to start keeping a comma seperated value in a hidden field, I find that
really messy. I am sure there is a really good way to do this as this seems
to be the power of web forms, I just need someone to tell me it!!!
Many thanks.