Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Radio button value


Message #1 by "Shaukat Desai" <shaukat.desai@g...> on Fri, 13 Oct 2000 14:48:32 +0100
you are missing ()

 var x
=(document.frmApprove.cboName.options[document.frmApprove.cboName.selectedIn
dex].value)
	if (x =='NR")
		{
			 alert("Please select a User");
		}
	else
		{
			  document.frmApprove.submit();
		}

hope this helps you



-----Original Message-----
From: Shaukat Desai [mailto:shaukat.desai@g...]
Sent: Friday, October 13, 2000 8:49 AM
To: javascript
Subject: [javascript] Radio button value


I have three radio buttons with values of Approve/Forward, Validate and
Final Approval,  If the user selects a radio button with values of
Approve/Forward or Validate I want to check if the user has selected a
User from the select box, if they have submit the form, If they haven't
prompt the user to select a User.

The script below keeps giving me error messages (object does not support
property...) on the form.submit.  Please can someone how a look at the
script and suggest any changes.

Thanks



function SubmitAction() {
//check to see if Approve/Forward or Validate To has a value
//if(document.frmApprove.rdoApprove.value == 'Validate' ||
document.frmApprove.rdoApprove.value == 'ApproveForward')
if(document.frmApprove.rdoApprove.value != 'FinalApproval')
	  {
   // if there is a value then check if a user has been selected
    if
(document.frmApprove.cboName.options[document.frmApprove.cboName.selectedInd
ex].value
=='NR')

	   {
		 //if no has been selected has not been selected prompt the user to
select one

		 alert("Please select a User");

	   }
   //if currency has been selected then submit form
	else
	   {

	   document.frmApprove.submit();

	   }
 }
//if ApproveForward or Validate  has not been selected then submit the
form
else
  {

  document.frmApprove.submit();

  }
}
</script>

---
NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS?  Is FREE okay?
Visit EarthWeb for the latest in IT Management, Software Development,
Web Development, Networking & Communications, and Hardware & Systems.
Click on http://www.earthweb.com for FREE articles, tutorials,
and discussions from the experts.
---


  Return to Index