Help Needed!!! client-side script, server-side code

S

Shawn Mehaffie

I have a form when the user clicks on a HTML Input control, a process runs
to submit the users order. While the process is running I wnat to disable
the button so the user cannot submit the form again. I have written client
side code to disable the button which is setup to run onclick. The client
side function runs (with alert but not code to disabel the button), then the
form is submitted and the ServerClick event is run. This is how it should
work according to the documentation.

The problem I am having is when I add the code to disable the sumbit button
then the server-side code does not run. Does anyone know of a way around
this? Is there a way to make the program run the server side code after
disabling the button?

I've tried to disable the button in the ServerClick event and run the
CCSubmit fucntion in a thread, but then the button disables properly but
does not enable correctly. The other important thing is that if there is an
error in the CCSumbit function I need to put the message in a label and make
the label visible. When I try this using a Thread the error message neve is
made visible either.

I really need an answer to his ASAP, so any ideas would be appreciated.

S. Shawn Mehaffie
PC Resources, LLC.

P.S. To me being the ability to run client-side and server side code the way
the documentation says should always run the server-side code, even if the
client-side disables the control. Other than validation code, the disabling
of the button that was pressed so users cannot press it again is a top use
for this feature. By not running the server-side code if you disable the
control you are putting a big limit on this.
 
S

Showjumper

When the button is clicked, You could send to user to a new page saying
their order is being processed
 
E

Eran Amitai

How did you submit the form from your client side onclick handler? You're
supposed to use the GetPostBackEventReference function.
 
S

Shawn Mehaffie

Thanks, but that is not how we want the applications to work. Thanks for
the suggestion.
 
S

Shawn Mehaffie

Thanks but I figrued out how to take care of this. The button control
automatically does a form post and calls ther server-side click event. The
problem was that in the client side code I was disabling the button, which
caused the server side code not to work. I am now using the styles.display
property and simply making the button in question invisible. By doing this
the button cannot be clicked again and the server-side code still runs.

Thanks for your suggestion,
S. Shawn Mehaffie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top