473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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
Expand|Select|Wrap|Line Numbers
  1.  <tr>
  2.           <td><label for="subject">Subject</label></td>
  3.           <td><select name="subject" id="subject" value="<?=$_SESSION['post']['subject']?>" >
  4.  
  5.             <option value="0" selected="selected">Choose</option>
  6.             <option value="Question">Question</option>
  7.             <option value="Business proposal">Business proposal</option>
  8.             <option value="Advertisement">Advertising</option>
  9.             <option value="Complaint">Complaint</option>
  10.           </select>         </td>
  11.          <td id="subjectInfo">Subject</td>
  12.         </tr>
  13.  
  14.  
With this javascript
Expand|Select|Wrap|Line Numbers
  1.  var subject = $("#subject");
  2. var subjectInfo = $("#subjectInfo");
  3.  
  4. form.submit(function(){
  5.         if(validateName() & validateEmail() & validateSubject() & validateName() & validateName()) 
  6.             return true
  7.         else
  8.             return false;
  9.     });
  10.  
  11. function validateSubject(){
  12.         if(this.selectedIndex > 0) {
  13.                subjectInfo.text("Valid");
  14.             subjectInfo.removeClass("error");
  15.             return true;
  16.         }     
  17.         // Not valid
  18.         else{
  19.               subjectInfo.text("NOT valid");
  20.               subjectInfo.addClass("error");
  21.               return false;
  22.  
  23.   }
  24.     }
  25.  
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??
Aug 5 '11 #1
1 939
can anyone help on this?
Aug 6 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: mufasa | last post by:
i believe deleting an already delete pointer should give me a segmentation fault! Why, then, is the following working? I am using gcc version 3.0.2. #include<stdio.h> #include <string> using...
1
by: Sunshine | last post by:
Pretty new to javascript so please help. Why isn't this working in my validateform()? if (document.This.strOld.value.compareTo(Session("strPassword")) != 0) { alert("Current password...
29
by: interpim | last post by:
Just a quick exercise from my C programming book, that I can't figure out why it isn't working properly. It kinda works but im getting wierd output. It is supposed to remove the vowels from text. ...
6
by: Christina Androne | last post by:
I've read the docs and evrything seems fine. Then what I am missing ? This is the code snippet: try {
4
by: Pipo | last post by:
The problem: I create a very simple custom control: public class cLabel : System.Web.UI.WebControls.Label { } I place the cLabel in a user control. When I place the user control on a page...
0
by: Simon Hart | last post by:
I can't seem to get this to work. I have applied the above attribute to a class library thats installed in the GAC. I am trying to use this shared assembly from a C# ASP.NET web form, but I am...
5
by: Peter Newman | last post by:
Im still struggling to get this executing a stored proc working .. im running vb.net (2003) and SQL 2005.. the story thus far is with a lot of help and a prevailing wind i have come up with the...
4
by: kiss848 | last post by:
Short background... relatively new to PHP and was given a project to integrate it with a MySQL db basically just to produce reports on inventory. I had to run a query and return a value from a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.