Hi,
I have two buttons on the form and I need to check if the first button was clicked. I click to the second button and first it should check if the first button was clicked, i.e. the data was submitted. If no, give an error message and stop execution. How can I achieve this via JS?
On click event checking
Moderators: Jon, Steve, Ian, Dave
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Presumably various fields are changed when your first button is clicked. You can test if a field has a non null value like this:
You could also get the script run by the first button to explicitly set a boolean field to show it's been clicked:
Then check this in the script for the second button (in this case it checks for a non null value of "true"):
Code: Select all
if (fields.FIELD1.value)
..do something
Code: Select all
fields.BUT1_CLICKED.value = true;
Code: Select all
if (fields.BUT1_CLICKED.value)
..do something
0 x
Who is online
Users browsing this forum: No registered users and 9 guests