Andy,

You can do this very easily in qForms using a dependency:

// this says if the "pay" field is equal to "personal_credit", than
// the "trooptaxnumber" field is required
objForm.trooptaxnumber.createDependencyTo("pay", "personal_credit");

You can see an example of this on this form:
http://www.pengoworks.com/qforms/docs/examples/advanced.htm

There's a lot of other code on the page, but the piece of code that actually
ties the Favorite Sport "Other" option to requiring the text box is just
this line:

objForm.FavSportOther.createDependencyTo("FavSport", "Other");

More on qForms can be found at:
http://www.pengoworks.com/qforms/

-Dan

>-----Original Message-----
>From: Andy Matthews [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, November 22, 2005 5:02 PM
>To: CF-Talk
>Subject: OT: Prevent form submission if radio button and text field are not
>filled out
>
>Anyone have any ideas?
>
>I've cut out a portion of a form on which I'm working:
>http://www.andyandjaime.com/uploads/radiojs.html
>
>It's supposed to pop an alert box (and disable the form) when you click
>"check out" IF
>a) You've got either of the top two options (troop check or troop debit)
>selected
>AND
>b) The tax exempt number is not filled in
>
>This part works fine, but it's ALSO supposed to reactivate the form once
>you've filled both of those requirements and it's not doing that.
>
>Does anyone have any ideas as to what's wrong? I'm sure it's something
>simple, but I don't know what it might be.
>
><!----------------//------
>andy matthews
>web developer
>ICGLink, Inc.
>[EMAIL PROTECTED]
>615.370.1530 x737
>--------------//--------->
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225067
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to