Forums

Confirmation box

dpap 08 May, 2009
Hi,
i want when someone clicks on he submit button to show up a confirmation box and if he clicks yes to continue, if clicks no to stay in the form.
I've tested this:

I put
function checkAction(myMessage)
{ result=confirm(myMessage);
if (result==true) { return true; } else { return false; }
}

on the field "Form JavaScript: (without the script tags)"
and
<input class="form_button" name="NEXT" type="submit" value="NEXT" onClick="return checkAction(\'bla bla bla\')" />
on the submit button.

When i open the form on my computer i get the box, when i open it on my site nothing comes up.

Any suggestions?
GreyHead 08 May, 2009
Hi dapa,

That looks Ok, try using FireBug in FireFox to debug it on your site.

Bob
Max_admin 10 May, 2009
Hi,

I don't think you need the slashes before and after the bla bla and its better to do this using a
onSubmit="return functionName()"
in the form tag attachment field!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
dpap 13 May, 2009
I've tested onsubmit, but nothing it just goes to the next page instead of asking me with a confirmation box. Any other suggestion? I'm trying to fix this for about a week and nothing. 😲
Max_admin 14 May, 2009
Hi dpap,

try it with a simple JS code like
function functionname { return false; }

if your settings is correct then your form should never submit, is is fine ?

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.