Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Required fields but ONLY if data entered in another field that isn't required
Old 06-22-2008, 10:38 PM Required fields but ONLY if data entered in another field that isn't required
Average Talker

Posts: 20
Trades: 0
I have a form that allows users to enter textbook information for their course. They need to include information such as author, publisher, book title, isbn, etc. They can enter information for more than one book if they choose.

I need to write some code that makes the publisher and book title fields required...but ONLY if they choose to add a first, second, third book.

I guess what I'm looking for is some help on how to create required fields that are dependent on some other field being selected/checked.
__________________
Website:

Please login or register to view this content. Registration is FREE
ffsja is offline
Reply With Quote
View Public Profile Visit ffsja's homepage!
 
 
Register now for full access!
Old 06-23-2008, 02:28 AM Re: Required fields but ONLY if data entered in another field that isn't required
nyef's Avatar
Ultra Talker

Posts: 265
Name: Lucas
Trades: 0
if (!thisfield.filledout && someotherfield.checked){
alert('you must fill it in!');
return false;
}
__________________
~nyef

Please login or register to view this content. Registration is FREE
nyef is offline
Reply With Quote
View Public Profile Visit nyef's homepage!
 
Reply     « Reply to Required fields but ONLY if data entered in another field that isn't required
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.71688 seconds with 12 queries