February 25, 200520 yr HELP,,, I have a form with a field "ori" and listvalue coming from the db as session (example below). I want to make the field required to select a value by user. If not selected then a pop window will remind or not continue if submitted. I tried javascript, and it works with text fields but with example below, not at all. Help needed. Thanks in advance. --------JAVA SCRIPT <script language="javascript">function validate(){ if (document.testform.ori.value==""){ alert("No Orientation Session. Please Enter a Session!") return false } return true }</script> ----------FORMAT <FORM ACTION="FMPro" METHOD="post" name=testform onsubmit="return validate()"> <INPUT TYPE=hidden NAME=-DB VALUE='enrdatab'> <INPUT TYPE=hidden NAME=-Lay VALUE='web'> <INPUT TYPE=hidden NAME="-Format" VALUE="record_detail_replyo.htm"> ----------field on form <select name ="ori"> [FMP-option: ori, list=session] </select>
February 26, 200520 yr Try this: --------JAVA SCRIPT <script language="javascript">function validate(){ if (document.testform.ori.selectedIndex < 0){ alert("No Orientation Session. Please Enter a Session!") return false } return true }</script> Garry
Create an account or sign in to comment