PDA

View Full Version : JavaScript validation needed



neroman
03-27-2012, 09:49 AM
Dear all,

The problem is that when I press submit button I got the following message at: www.cypruspainters.net/repatchafail.html

The page cannot be found

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

--------------------------------------------------------------------------------

Please try the following:
•Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
•If you reached this page by clicking a link, contact the Web site administrator to alert them that the link is incorrectly formatted.
•Click the Back button to try another link.

HTTP Error 404 - File or directory not found.
Misk.com Hosting Service



This happens even when I keep one or all the fields of the form empty. Even more if I fill/write something or not fill/write something the Captcha words.

According to confirm.htm firstly, the user gets a confirmation which shows to the user that the form was completed succesfully.

Secondly, I would like to inform the user that their info passed to webmaster and also if it possible, to show user's input (what the user has written to the form).

I have attached the three related files which I use locally through Microsoft Expression Web 4 before uploading any changes.

Answer from my provider:



Within the .mf file, you have it specified to go to repatchafail.html when there is a failure with the captcha. Right now that page doesn't exist on your website, so you'll need to create a repatchafail.html and upload it. To help users on your site, you'll want to setup that page to let them know why they are seeing it.

As for when captcha failed page shows up, whenever the text entered in the captcha is incorrect or it's simply not filled in, users will be redirected to the captcha failed page. We did some testing on your site and so long as the captcha is correctly written in, it is successfully submitted. The only time that captcha failed page shows up is when the captcha field is blank or incorrect. Please note that this will occur with our without the other form fields being blank. There isn't any server side form validation so the other form fields can be left blank. If you want to validate and ensure the other fields in your form are filled in, you'll need to setup some JavaScript validation on the page. If you're not familiar with doing that, we'd recommend searching online. There are a number of sites that will provide help with writing form validation. You can find a list of search results at http://bit.ly/GRYLdX . Microsoft Web Expression may also provide some assistance in setting that up so you may want to check their help documentation.

On the confirmation/success page (http://www.cypruspainters.net/confirm2.htm), it's listing information not relevant to your form. Apparently you were using a form plugin with Microsoft Expression which relates to that. With our mail form service, you can't pass the input values to the confirmation page. That's not currently an option. That said, we add new features such as this based on demand. So, we've added your name to a feature request list and you'll be notified if and when that feature is added to our mail form service.

So, for the confirmation page, you'll need to delete what's on there and replace it with a notification telling your users it was successful and that it has been sent to the webmaster. The confirmation/success page can say anything you want. It's simply an HTML page you create where the form redirects to when it is successfully submitted.


Please help!

traq
03-27-2012, 03:17 PM
Answer from my provider:

Within the .mf file, you have it specified to go to repatchafail.html when there is a failure with the captcha. Right now that page doesn't exist on your website, so you'll need to create a repatchafail.html and upload it. To help users on your site, you'll want to setup that page to let them know why they are seeing it.

As for when captcha failed page shows up, whenever the text entered in the captcha is incorrect or it's simply not filled in, users will be redirected to the captcha failed page. We did some testing on your site and so long as the captcha is correctly written in, it is successfully submitted. The only time that captcha failed page shows up is when the captcha field is blank or incorrect. Please note that this will occur with our without the other form fields being blank. There isn't any server side form validation so the other form fields can be left blank. If you want to validate and ensure the other fields in your form are filled in, you'll need to setup some JavaScript validation on the page. If you're not familiar with doing that, we'd recommend searching online. There are a number of sites that will provide help with writing form validation. You can find a list of search results at http://bit.ly/GRYLdX . Microsoft Web Expression may also provide some assistance in setting that up so you may want to check their help documentation.

On the confirmation/success page (http://www.cypruspainters.net/confirm2.htm), it's listing information not relevant to your form. Apparently you were using a form plugin with Microsoft Expression which relates to that. With our mail form service, you can't pass the input values to the confirmation page. That's not currently an option. That said, we add new features such as this based on demand. So, we've added your name to a feature request list and you'll be notified if and when that feature is added to our mail form service.

So, for the confirmation page, you'll need to delete what's on there and replace it with a notification telling your users it was successful and that it has been sent to the webmaster. The confirmation/success page can say anything you want. It's simply an HTML page you create where the form redirects to when it is successfully submitted.

Your provider seems to have answered both of your questions directly. Is there something, specifically, that you don't understand?

neroman
03-27-2012, 03:57 PM
Your provider seems to have answered both of your questions directly. Is there something, specifically, that you don't understand?

Hi,

Do you know where to find a JavaScript validation on the page?

The url: http://bit.ly/GRYLdX seems to be a dead link!

Thanks

traq
03-27-2012, 06:49 PM
? works fine for me (not a dead link).

links to Google search results for "javascript form validation."

Presumably, any of those sites might offer something useful to help you learn about validating forms using javascript (though I would recommend against w3schools (http://w3fools.com)).



I know I already mentioned this in your last thread, but:
a) if you want to do things best done server-side (like processing form submissions),
b) you need to find a new host that allows server-side scripting.

Additionally, if you want to learn server-side scripting (even if you don't, honestly), I would recommend dropping Expression Web (along with ANY other WYSIWYG html editor) and using a plain text editor. Notepad++ (http://notepad-plus-plus.org) is a good choice for windows, but there are many more.

keyboard
03-27-2012, 10:00 PM
Presumably, any of those sites might offer something useful to help you learn about validating forms using javascript (though I would recommend against w3schools (http://w3fools.com)).


Why do yu recommend against them. Everybody does, but I don't think they're that much worse than any of the other tutorials out there

Keyboard1333

traq
03-27-2012, 10:13 PM
Why do yu recommend against them. Everybody does, but I don't think they're that much worse than any of the other tutorials out there

Keyboard1333

follow the link (http://w3fools.com) :)

w3schools: is terribly inaccurate and/or misleading in many places
is not affiliated with the w3c (and capitalize on, rather than correct, this misconception)
sells certifications that are useless from both technical and practical standpoints
crowds out better web resources (e.g., from the ground up (http://code.google.com/edu/submissions/html-css-javascript/), sitepoint (http://reference.sitepoint.com), MDC (https://developer.mozilla.org/en-US/docs))