3

I'm trying to use form validation that is working in this example with my jQuery Mobile project:

http://jsfiddle.net/elijahmanor/A8jt3/light/

This example works but uses an older version of jQuery Mobile js and css files. I'm working with the 1.0 release version which appears to have broken this form validation. You can see my updated version at:

http://jsfiddle.net/8dHg9/3/

You'll notice when you click the Login button you get the alert messages but they are not in red and are in the wrong location compared to the original version.

Can anyone locate what broke the original version and how to restore functionality to new version using jQuery Mobile 1.0?

1 Answer 1

3

Try this:

http://jsfiddle.net/8dHg9/37/

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you so much that appears to work fine. Really appreciate your assistance. If you have a chance to explain how you went about debugging this that would also be helpful so I can learn how to do this - wasn't sure whether to start with the CSS or the js files.
No worries ;) So your issue was in your CSS. You were defining style classes that you never used (.portrait .landscape). It is possible that you have js adding the the class dynamically but the way your markup is defined now your screen dimensions shouldn't matter - your error text will always remain consistent with your input fields. Nothing else but CSS needed changing.
I am not sure about this but in version 1.7> of jquery, validation method doesn't exist, you must include jquery validation plugin : docs.jquery.com/Plugins/Validation
@SAFAD You know you can use the dropdown on the left hand side of the jsFiddle window to select the version of jQuery and test your query before posting it... The included scripts don't contain additional plugins as far as I can see.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.