Form submitting

  • Thread starter Thread starter Corinne
  • Start date Start date
C

Corinne

Hi All,

Recently tried to move from asp to visual studio 2005.

I have a form and a button.

I want the button to call a function and change a few of the hidden fileds
value before the form is submitted.

In asp, I used to call a javascript function and then the form.submit()
function.

What woul dbe the best equivalent/practice using Visual Studio 2005?

Thank you

Corinne
 
My suggestion would be to use the Button.OnClientClick property (which
basically sets the JavaScript onclick event of the Button) to modify the
desired hidden fields. If you do this, when the Button is clicked the
JavaScript you assigned to the Button.OnClientClick property will be
executed and then the form will be submitted. This way, you will not need to
worry about including the form.submit() method in your code, and the form
will not get submitted twice. Good Luck!
 
Back
Top