submit handler action BEFORE submit?

  • Thread starter Jörn Willhöft
  • Start date
J

Jörn Willhöft

Hi there,

for my completely database based form I need to do scripting just BEFORE the
form is submitted. I tried the following:

- register for the onClick() event of a submit button
--> calls the registered function AFTER the submit action
- register for the onSubmitRequest() event
--> forces me to implement the whole submit action myself. Explicitly
calling XDocument.Submit() out of this function is not allowed.

All I want is to add some additional action before the usual database
update. How can I do that?

Thanks in advance,
Jörn
 
S

S.Y.M. Wong-A-Ton

I think you've pretty much answered your own question by coming up with the
second solution. :)

You need to write code in the OnSubmitRequest() event handler. At the end of
the event handler, use

eventObj.ReturnStatus = true;

to indicate success. Before this line of code you can write code to submit
changes to the database with

XDocument.DataAdapters["Main connection"].Submit();

where "Main connection" is the name of the data connection to the database.
You must/cannot use XDocument.Submit() to submit the form; but you already
discovered this. And before this line you can write your code that must run
before the submit takes place.
 
J

Jörn Willhöft

Thank you!
XDocument.DataAdapters["Main connection"].Submit();

That did the trick.
Unfortunately I cannot find the Submit() function in the online
documentation anywhere, even now that I know it's there.

Again, thank you very much,
Jörn


S.Y.M. Wong-A-Ton said:
I think you've pretty much answered your own question by coming up with
the second solution. :)

You need to write code in the OnSubmitRequest() event handler. At the end
of the event handler, use

eventObj.ReturnStatus = true;

to indicate success. Before this line of code you can write code to submit
changes to the database with

XDocument.DataAdapters["Main connection"].Submit();

where "Main connection" is the name of the data connection to the
database. You must/cannot use XDocument.Submit() to submit the form; but
you already discovered this. And before this line you can write your code
that must run before the submit takes place.
---
S.Y.M. Wong-A-Ton


Jörn Willhöft said:
Hi there,

for my completely database based form I need to do scripting just BEFORE
the form is submitted. I tried the following:

- register for the onClick() event of a submit button
--> calls the registered function AFTER the submit action
- register for the onSubmitRequest() event
--> forces me to implement the whole submit action myself. Explicitly
calling XDocument.Submit() out of this function is not allowed.

All I want is to add some additional action before the usual database
update. How can I do that?

Thanks in advance,
Jörn
 
S

S.Y.M. Wong-A-Ton

You're welcome!
---
S.Y.M. Wong-A-Ton


Jörn Willhöft said:
Thank you!
XDocument.DataAdapters["Main connection"].Submit();

That did the trick.
Unfortunately I cannot find the Submit() function in the online
documentation anywhere, even now that I know it's there.

Again, thank you very much,
Jörn


S.Y.M. Wong-A-Ton said:
I think you've pretty much answered your own question by coming up with
the second solution. :)

You need to write code in the OnSubmitRequest() event handler. At the end
of the event handler, use

eventObj.ReturnStatus = true;

to indicate success. Before this line of code you can write code to submit
changes to the database with

XDocument.DataAdapters["Main connection"].Submit();

where "Main connection" is the name of the data connection to the
database. You must/cannot use XDocument.Submit() to submit the form; but
you already discovered this. And before this line you can write your code
that must run before the submit takes place.
---
S.Y.M. Wong-A-Ton


Jörn Willhöft said:
Hi there,

for my completely database based form I need to do scripting just BEFORE
the form is submitted. I tried the following:

- register for the onClick() event of a submit button
--> calls the registered function AFTER the submit action
- register for the onSubmitRequest() event
--> forces me to implement the whole submit action myself. Explicitly
calling XDocument.Submit() out of this function is not allowed.

All I want is to add some additional action before the usual database
update. How can I do that?

Thanks in advance,
Jörn
 

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

Top