close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Adding a alert message.

Thread began 1/06/2014 8:38 pm by gary917 | Last modified 1/08/2014 2:49 pm by Jason Byrnes | 866 views | 13 replies |

gary917

Adding a alert message.

Hi I have a long form and have found that some users think they have filled out the form correctly when they have not. Because of the length of the form they are missing some of the error messages that are appearing at the top of the form. Can you suggest away that I can prevent this from happening? I was thinking of generating a popup message to alert the user that alerts the user of the form may not be filled in correctly. But I am unsure how to generate this message. Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

spry validation does not offer a way to open an alert on validation fail.

you could add an onclick event to the submit button to scroll to the top:

onclick="window.scrollTo(0, 0);"

this may help some but not if the errors are in the middle of the page.

Sign in to reply to this post

gary917

Possible with addition

Instead of an alert message would it be possible do what you suggested along with opening a div at the top of the page using something like...

<?php if(isset($_GET['sent']) && $_GET['sent'] == "false") { ?>
<div class="confirm">Please check your forms for errors.</div>
<?php } ?>

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

sure, but dont add the if statement around the div, and add a style to set it to hidden by default:
<style type="text/css">
.confirm { display: none; }
</style>
<div class="confirm" id="confirm">Please check your forms for errors.</div>

then use this for the onclick:
onclick="window.scrollTo(0, 0);document.getElementById('confirm').style.display = 'block';"

Sign in to reply to this post

gary917

type="submit"

This script is not working, I think it is because I am using the type="submit" instead of type="button". In full I am using the following for the form button action...

<input class="formButton" name="TZAuto_submit" type="submit" id="TZAuto_submit" value="Contact me" onclick="window.scrollTo(0, 0); document.getElementById('confirm').style.display = 'block'; clearAllServerErrors('TZAuto_TZContact_TZContact')" tabindex="40" />

Can you suggest away to fix this?

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

i need a link to see the problem and copy of the page to see the code in context.

Sign in to reply to this post

gary917

Link and Code

I have provided the link and the code in the private message section.

Sign in to reply to this post

Jason ByrnesWebAssist

1) the link you sent is for the message sent page not the form page.

2) instead of pasting the code from the page in your message, it is better to compress the original php page to a zip archive and attach the zip file.

3) the confirm div is inside an message span:

<span class="emailFormError"><div class="confirm" id="confirm">Please check your forms for errors.</div></span></div>

remove the span tag.

Sign in to reply to this post

gary917

Sorry about that

Here is the correct link and the compressed file. I have removed the span tag from the page but it did not change the functioning of the page.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

try changing onclick to onmousedown:

onmousedown="window.scrollTo(0, 0);document.getElementById('confirm').style.display = 'block';clearAllServerErrors('TZAuto_TZContact_TZContact')"

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...