close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Validate form elements on checkout page

Thread began 6/29/2009 2:18 pm by grantr281040 | Last modified 9/29/2009 11:26 am by Jimmy Wu | 4113 views | 13 replies |

grantr281040

Validate form elements on checkout page

Hey Ray!

A couple of years ago I was using coldfusion, and had this question and during a mentor session, and you showed me a quick way to validate some of my form items before bad info can be passed from the checkout page to the confirm page.

If bad info was entered a small dialog box popped up and would not allow the page to be submitted.....so if for instance an email address was not valid or if a cvv code was not entered or if the cc number was not the correct amount of digits.

Now I have moved to PHP and it has been a while and I cannot remember how we did it. I think it was some type of form action but I don't even know where to start.

Any ideas?

Thanks

Grant

Sign in to reply to this post

Ray BorduinWebAssist

These days the best way in my opinion is to use spry and webassist validation toolkit server validation. At the time we used, and you could still use, webassist client validation, which is also part of validation toolkit.

Sign in to reply to this post
Did this help? Tips are appreciated...

grantr281040

I thought it was just some sort of code that triggered a dialog box to pop up but looking at it now it appears to be a WA thing. As I remember....it was a very quick an easy thing...(for you anyway). I think this is it in my old coldfusion code in my checkout page. I guess I should stay away from spry right now as I know nothing about it.

How would I recreate this same type of scenario in php? Is there some sort of tutorial somewhere? Sorry for the questions but I'm not sure how to implement this.

I assume I do it on the checkout page and add a serverbehavior with the "+" button? and then to validation toolkit and then to server validations?

If that is correct....then it should be triggered by..."current page submit"?
"validation type" looks self explanitory and then
how can I determine the "server variable"?
and what goes in the big box with the "+" button above it...is that the message that appears when it is an invalid entry?

"failure redirect" I assume should be the same checkout page? (Return to the same page to reenter the information?)

<form action="confirm_cc.cfm" method="post" name="ecart_checkout_form" onsubmit="WAValidateCC(document.ecart_checkout_form.cc_number,document.ecart_checkout_form.cc_number.value,'- Invalid credit card number','','4:51:52:53:54:55:34:37:6011:',document.ecart_checkout_form.cc_number,0,true);WAValidateEM(document.ecart_checkout_form.email,document.ecart_checkout_form.email.value,'- Invalid email address',document.ecart_checkout_form.email,0,true);WAValidateRQ(document.ecart_checkout_form.cvv,'- CVV Entry is Required',document.ecart_checkout_form.cvv,0,false,'text');WAAlertErrors('The following errors were found','Correct invalid entries to continue',true,false);return document.MM_returnValue">


Thanks!

Grant

Sign in to reply to this post

Ray BorduinWebAssist

You should follow the samples and tutorials provided. You have so many questions my quick response couldn't do it justice. It appears you may need the getting started guide provided to get a general idea of the concepts involved.

Don't be afraid of spry. It is very simple to use in CS3 and CS4 (CS4 has additional options).

Sign in to reply to this post
Did this help? Tips are appreciated...

grantr281040

You were right...I looked around and found what I needed in the tutorials. What I needed to do to solve this one was to go to insert> WebAssist> Validation Toolkit> Client Validation.

That brought up a dialog box that asked me which "form" to validate and then walked me through a simple wizard to complete the task. VERY EASY!

SOLVED...THANKS!

Sign in to reply to this post

MeyerJ196339

Validate form elements on checkout page

I have been searching and reckon this thread is the closest to what I need!

I want to validate the credit card and billing address fields in checkout.asp (created by the eCart wizard). I applied server side validation to the confirm.asp page and it works brilliantly. My only problem is that I am returned to the checkout.asp page (quite correctly) but I can't work out how to display an error message on that page to the user. Is this possible?

Sign in to reply to this post

Jimmy Wu

You will have to write out the error message on the page and then apply a Validation show if behavior to that error message.

Sign in to reply to this post

MeyerJ196339

Thanks Jimmy. I don't suppose you could show me a vbScript example of how to write out the error message (or point me in the right direction), could you? I know how to do use the show if behaviour, but I'm unfamiliar with "writing out" an error message

Sign in to reply to this post

MeyerJ196339

Originally Said By: MeyerJ196339
  I'm unfamiliar with "writing out" an error message  



Thinking about it, maybe you mean saving the errors to a session variable and testing against this in th checkout.asp? I'm a complete amateur so perhaps it's the terminology that's confusing me?

Sign in to reply to this post

Jimmy Wu

Sorry about not being clear. You put what you want as the error message onto the page in the position you want it to show up. You can do this in design view so that its easier to visualize if you're not strong in coding.

After adding this to the page, you will have to highlight the message and apply the validation show if server behavior. Specify which validation will cause the error to show up and apply it. This will cause the error to only show up if that particular validation fails.

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...