![]() |
Styling to highlight form validation errors with CSS
I'm trying to style the results of a form's validation when there are errors. I'm using Shopp in Wordpress. So far, I've figured out how to get the erroneous fields to change (highlight) background colors, only I haven't been able to make this work for fields in which there is a drop-down rather than just an input box. Here's the code that works. Hopefully this is enough info to go on:
Code:
#shopp form .required {Amy |
Can we see some html code? Plus i'm finding it hard to follow what you would like done.
|
Thanks for asking!
Here's the form in question If you put an item in the shopping cart and hit checkout you'll see the form in question. If you try leaving fields blank on the form, you will see that they turn pink when you try to checkout. I can't figure out how to get the dropdown fields (State or Province) to do the same. I also don't know how to get a message to show up that alerts the user to the errors in the form (though I know that latter thing is not a CSS issue). I built this with Wordpress and the Shopp plugin and am not sure how to access the HTML (only the parsed HTML via Firebug) but this an example of what I've got when I try submitting a blank form... Code:
<div class="left"> |
Try
Code:
#shopp form .required { |
Nope. That doesn't highlight the error but it does highlight the drop down menu on the previous (/cart) page in the field that says "estimate shipping & taxes for:" even though there is no way to have an error in that field because you can't leave it blank! Weird.
Any other ideas? |
Also I tried a correction, added missing comma to this line:
Code:
#shopp form input.error, input[type="text"], select{ |
Hello,
Did you try Code:
#shopp select.error {It has to be placed after Code:
#shopp form .required { |
| All times are GMT +1. The time now is 02:47 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.