Presentation is loading. Please wait.

Presentation is loading. Please wait.

Conditionally Confirming a Submit

Similar presentations


Presentation on theme: "Conditionally Confirming a Submit"— Presentation transcript:

1 Conditionally Confirming a Submit
This Learning Module shows how to use EGL/JSF and JavaScript to conditionally confirm a submit with the user.

2 Conditionally Confirming a Submit (if a value on a page changes)
Often times you will want to confirm a submit with the user before letting it happen. Using a small dialog box (like the one above) is a common way of doing this. In previous discussions we’ve talked about how to program a confirm prompt using the tooling, but what about if you only want to confirm if they’ve made a change to the page? We can use a series of JavaScript events and some simple code to achieve this. First we’ll need to add an onChange event to a field (or whatever is being submitted)

3 Conditionally Confirming a Submit (if a value on a page changes)
As you may have noticed already, this technique requires a hidden field to be present on the page. Next, your submit button needs to contain an onClick event that will check to see if the content to be submitted has changed. If and only if, confirm that the user wants to submit. This script will check if the value in the hidden field is true, if so the page content has been changed and a confirm window will be created. Once this is done, the value in the hidden field is set back to false.


Download ppt "Conditionally Confirming a Submit"

Similar presentations


Ads by Google