close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

validate checkout page

Thread began 12/04/2010 3:28 pm by kris517211073 | Last modified 12/09/2010 9:50 am by Jason Byrnes | 2617 views | 18 replies |

kris517211073

validate checkout page

i try to use validate tool to validate checkout page, i need state and shipping type to be selected in oder to proceed to the next page, i unable to validate the state since "select a state" already there, it's go to the next page even you are not select the state

how can i validate selected state, Please help, thanks very much.

Sign in to reply to this post

neilo

Hi Kris,

Try removing the 'select a state' option, and replace it with an option with a blank value, i.e:

<select name="state">
<option selected="selected"></option>
<option>Alabama</option>
<option>Alaska</option>
<option>Arizona</option>
<option>Arkansas</option>
<option>California</option>
etc.



If the validation is just 'Required', then an option containing a value would need to be selected to pass validation.

Sign in to reply to this post

kris517211073

thanks for your respond

if i remove the "select a state" option, and it will look blank,
but i do want 'select a state' to appear to tell customer to pick an aption , validation need to be required and selected
how can i achieve that, your help will be very appreciated

Sign in to reply to this post

CraigRBeta Tester

for your state option "select a state", you need to keep the display label as "select a state" or whatever, but its value should be an empty string, "".

your server validation should be Required/Not Blank/Selection Made.

this should be all you need

Sign in to reply to this post

neilo

test_select.php

Also, might be useful:

Zipped folder containing Select Lists (text docs) for:

US States (without codes): <option>Alabama</option>
US States (with codes): <option value="AL">Alabama</option>
UK Counties
Countries

Sign in to reply to this post

Jason ByrnesWebAssist

Like CraigR said, your initial option should have a value attribute set to a blank string:
<option value="" selected="selected">Select A State</option>


Then use required validation on the state select list.



Neilo: with the differences in how browsers handle form elements lately, i have found that some browsers will not pass a form element if it does not have a value attribute set. I have seen this happen for text elements, checkboxes and even select lists.


because of this, I would not recommend using select lists that do not have the value attribute, even if the value is the same as the label.

Sign in to reply to this post

neilo

Many thanks (again) Jason, - I always appreciate you taking the time to explain things. I am a bit worried that you should really soon be charging me for this!

Sign in to reply to this post

Jason ByrnesWebAssist

No worries neilo

Sign in to reply to this post

kris517211073

hi jason
thanks for your response
as you said if i do it like this <option value="" selected="selected">Select A State</option> the initial option is there, but the validation will not work on this
CraigR tell me to label as "select a state" but initial option is blank ( i have see it on test_select.php)
But what i want is I WANT INITIAL OPTION to display 'select a state' and i want it to validate if it selected or not , i want to achieve this , how could i achieve that, help me jason ,thanks

Sign in to reply to this post

Jason ByrnesWebAssist

setting the initial value to a blank string:
<option value="" selected="selected">Select A State</option>

should work.


If it is not working, i will need to see an example page in place that demonstrates it not working to see what is wrong.

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