if ( (document.yourFormName.selectAdmin.selectedIndex == 0) && ( (document.yourFormName.theTextFieldName.value == "") || (document.yourFormName.theTextFieldEmail.value == "") ) ) { alert('you did it all wrong!'); return false; }
this assumes that the 'Other' option will always be the first option in the select list. if this changes, you can modify the first line of the 'if' as so: if ( (document.yourFormName.selectAdmin.options[document.yourFormName.selectAdmin.selectedIndex] ..value== "xox") && ....etc On 10/10/06, Les Mizzell <[EMAIL PROTECTED]> wrote: > This is probably going to take more javascript than I know how to do, > since I suck at javascript... > > First page of a multi-part form has a drop-down of admin namex to pick from. > > > <select name="selectAdmin"> > <option value="xox">Other - Enter Information Below!</option> > <cfloop query="AIData"> > <option value="#MyData.AdminEmail#">#MyData.AdminNam1#</option> > </cfloop> > </select> > > If you ain't in the list, then you should fill in "adminNAME" and > "adminEMAIL" text fields below that. > > > I've not quit figured out how to validate this on one page. If "Other" > is picked in the select, then I need validation for "adminNAME" and > "adminEMAIL" to happen before the form can be submitted. If "Other" > ain't picked, then ignore them... > > I can check for this on the NEXT page of the form and force them to fill > in the blanks there, but I want it to take place all on the first page. > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256134 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4