DotDragnet
May 23, 2012, 04:16:22 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: follow us on twitter @dotdragnet
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: More jquery shenanigans  (Read 624 times)
Charisma Bypass
Hero Member
*****
Posts: 556



View Profile Awards
« on: January 20, 2010, 04:21:52 PM »

This should be really easy, but I can't get anything to work;

Name: <input name="id[txt_8]" id="id[txt_8]" size="50" maxlength="50" value="" type="text"> (required)
Waiver:<input name="id[7]" value="3" type="checkbox"> (required)
Website: <input name="id[txt_9]" id="id[txt_9]" size="30" maxlength="30" value="" type="text">

So that's the form, and two of the inputs are "required" (name and waiver).  What I want to do is this:

Change the word (required) to (thank you) as each is filled out.  No other checking other than determining if the (required) input is empty or not.

I've been farting about with it for hours but cannot come up with a working solution. If necessary I could probably add a ;     rel="required" to the required fields if that would help the situation.

In addition, the submit button should not work until all the required bits and pieces are filled out.

Any help would be -very- appreciated and I would owe a favour to anyone who can solve it. TYVM
Logged
samhs
Administrator
Hero Member
*****
Posts: 1711



View Profile WWW Awards
« Reply #1 on: January 20, 2010, 05:06:50 PM »

I wrote a tutorial for Web Designer mag a while back that deals with a very similar issue:

http://www.webdesignermag.co.uk/tutorials/add-client-side-form-validation-with-jquery/

Not exactly the same as what you're looking for, but close enough to probably answer your question if you ignore the fancy animation stuff.

http://hs-demo.co.uk/forms/ a demo of the tutorial in effect.

hth
Logged

Loose adj a not held together; not fastened or firmly fixed in place
Lose verb to misplace something. To fail to keep or obtain something, especially because of a mistake, carelessness, etc.
---
Blog: www.ohwrite.co.uk
Twitter: www.twitter.com/samhs
samhs
Administrator
Hero Member
*****
Posts: 1711



View Profile WWW Awards
« Reply #2 on: January 20, 2010, 05:14:40 PM »

(the basic solution was to dynamically add a class when the form field is validated that replaces the required marker - which was also set with a class - with a tick)

All the code you need is in the tutorial.
Logged

Loose adj a not held together; not fastened or firmly fixed in place
Lose verb to misplace something. To fail to keep or obtain something, especially because of a mistake, carelessness, etc.
---
Blog: www.ohwrite.co.uk
Twitter: www.twitter.com/samhs
Charisma Bypass
Hero Member
*****
Posts: 556



View Profile Awards
« Reply #3 on: January 22, 2010, 10:29:23 AM »

Thanks Sam smile
That tute came in handy.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!