submit confirmation

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

submit confirmation

#1

Postby xren » Tue Oct 27, 2015 4:13 pm

Hi,

I have user request after click save button, the form need to check if some fields are filled out, if not then popup a dialog windows remind user and ask if they want to proceed or not, if user click ok then continue save, if not then remain on the page with out any action.

How this can be done?

I tried the html element properties' jQuery with click event on the button and the confirm javascript dialog but it does not work on controlling the submit or not.

Thanks,
Xiaoli
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Tue Oct 27, 2015 4:34 pm

Xiaoli,

I think I would use a jQuery click event on the button, and then display a jQuery dialog popup. This allows you to popup a panel containing a text and add buttons to it. You would need to create a panel containing your text, give the panel an id and add css display:none; There are examples of doing this on stackoverflow. At the end of your jQuery click event you should add "return false" to stop the form being submitted to the server at this point.

When the buttons are clicked you take whatever action you want to e.g. you could call the server to do the save using $eb.executefunction("doSave", null, true, true). The two "trues" are respectively: refresh the page, and submit all form fields.

Regards
Jon
0 x


Who is online

Users browsing this forum: Bing [Bot] and 7 guests