Simple alert message after submitting form

konsument 10 Nov, 2009
Hi all,

I have been searching for hours now to get this work.

I just want to have a simple js alert message "Thank you..." after the form has been submitted and get redirected back to the form. If I enter a alert("Blablabla.."); in the "On Submit code - after sending email:" it doesnt work. I already tried different varieties of solutions I found here in the forum - but no success.

Could somebody please help me with this? 😟
GreyHead 10 Nov, 2009
Hi konsument,

I'm nto sure how you'd do this. It's a little unusual to set off a JavaScript alert after a server event (rather than a browser event).

It has to be in the Form HTML because the OnSubmit code won't display in the browser if you are re-displaying the form.

I guess that you could add the alert to the onLoad event for the form page. You'd need to add a little code not to show it unless the page was being redisplayed though.

Why a JavaScript alert? Wouldn't a message on the page do the same job?

Bob
konsument 10 Nov, 2009
Hi Bob,

I need an alert message because theres not enough space to insert a message within the form.

I already tried this solution here: http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=10650&p=10702&hilit=alert+after+submit#p10702
but unfortunately it didnt worked.

After playing around I finally found something that works:

<script> 
alert('Thank you message'); 
window.location = "back to the form url"
</script>


Although it isnt a really nice solution but i works 🙂

Thanks for your help
GreyHead 10 Nov, 2009
Hi knosument,

If that does the job - great!!

Bob
This topic is locked and no more replies can be posted.