|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I put the following code in, but the first condition is never met! Why?
function verification() { /* VERIFY THAT COMPANY NAME IS ENTERED */ if ((document.newcompfrm.compname.value=='')| |(document.newcompfrm.compname.value==' ')) { alert('You must enter a company name!') document.newcompfrm.compname.focus() return false } /* VERIFY THAT A COMPANY CLASSIFICATION CODE WAS SELECTED */ if (document.newcompfrm.cccsel.options[document.newcompfrm.cccsel.selectedIndex].value=='') { alert('You must select a Company Classification Code!') document.newcompfrm.cccsel.focus() return false } document.newcompfrm.submit() return true } |
|
#2
|
|||
|
|||
|
What I spot right off the bat that could be preventing the condition from being met, is your OR operand "| |" should not contain a space, making it "| |".
|
|
#3
|
|||
|
|||
|
excuse me, i ment "| |"
|
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > problem with if construct |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|