troubleshooting Question

javascript - making html form fields required

Avatar of sknoll84
sknoll84Flag for United States of America asked on
JavaScriptHTML
86 Comments1 Solution852 ViewsLast Modified:
this is the beginning of my form:

<FORM NAME="myForm" ACTION="[LL_CGIPATH /]" ENCTYPE="multipart/form-data" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="func" VALUE="[LL_FUNC /]">
<INPUT TYPE="HIDDEN" NAME="LL_FUNC_VALUES" VALUE="[LL_FUNC_VALUES /]">
<INPUT TYPE="HIDDEN" NAME="LL_AttrFieldName" VALUE="">
<INPUT TYPE="HIDDEN" NAME="LL_AttrFieldIndex" VALUE="">
<INPUT TYPE="HIDDEN" NAME="LL_WFATTURL" VALUE="[LL_WFATTURL /]">


this is my button to submit the form:

<INPUT CLASS="applyButton" TYPE="BUTTON" VALUE="Apply" NAME="IgnoreMe" ONCLICK="doFormSubmit( document.myForm );">


this is a selection box that i need to require:
[i]options APPROVE or REJECT must be selected, alert user if not selected[/i]

<SELECT CLASS="selectMenu" ID="_1_1_68_1" NAME="_1_1_68_1" ONCHANGE="setDate(this.value);">
<OPTION VALUE="" >&lt;None&gt;</OPTION>
<OPTION VALUE="Approve" >Approve</OPTION>
<OPTION VALUE="Reject" >Reject</OPTION>
</SELECT>


this is a text box that i need to require:
[i]if the value of this text box is null, then alert user[/i]

<INPUT CLASS="valueEditable" TYPE="TEXT" NAME="_1_1_8_1_Name" ID="_1_1_8_1_Name" VALUE="" ALT="Select User" SIZE="23" ONCHANGE="KeepFieldSet_1_1_8_1( this, this.form._1_1_8_1_SavedName.value )">



so i have a text box and a selection box that i must validate onSubmit of my form.  this form was exported from an application so i'm stuck with the fields listed above.  i'm not too savvy with javascript - please help me require these fields!

thanks!!!
ASKER CERTIFIED SOLUTION
CCSOFlag

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 86 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 86 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros