Why is this not working???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bytesFTW99
    New Member
    • Nov 2008
    • 15

    Why is this not working???

    I have this code it works fine validates fine until i press submit and it fails

    just a simple drop down box
    Code:
     <tr>
              <td><label for="subject">Subject</label></td>
              <td><select name="subject" id="subject" value="<?=$_SESSION['post']['subject']?>" >
              
                <option value="0" selected="selected">Choose</option>
                <option value="Question">Question</option>
                <option value="Business proposal">Business proposal</option>
                <option value="Advertisement">Advertising</option>
                <option value="Complaint">Complaint</option>
              </select>         </td>
             <td id="subjectInfo">Subject</td>
            </tr>
    With this javascript
    Code:
     var subject = $("#subject");
    var subjectInfo = $("#subjectInfo");
    
    form.submit(function(){
    		if(validateName() & validateEmail() & validateSubject() & validateName() & validateName()) 
    			return true
    		else
    			return false;
    	});
    
    function validateSubject(){
    		if(this.selectedIndex > 0) {
       			subjectInfo.text("Valid");
    			subjectInfo.removeClass("error");
    			return true;
    		} 	
    		// Not valid
    		else{
    	  		subjectInfo.text("NOT valid");
    	  		subjectInfo.addClass("error");
    	  		return false;
       
      }
    	}
    Again it works fine up until i press submit and it goes from valid to not valid! can anyone tell me what i am not seeing??
  • bytesFTW99
    New Member
    • Nov 2008
    • 15

    #2
    can anyone help on this?

    Comment

    Working...