Start New Discussion within our Web Development Community

I am having the form

<script src="//"></script>
<script src="form.js"></script>
$query="SELECT * FROM user";

<div id="contact_form">
<form name="contact" action="">
<label for="txn_unit" id="txn_unit">Txn Unit</label>
<SELECT name="name" id="name">
<OPTION value="<? echo $row['id']; ?>"><? echo $row['first_name']; ?></OPTION>
<label class="error" for="name" id="name_error">Owner name field is required.</label>

<label for="description" id="desc_label">Description</label>
<input type="text" name="desc" id="desc" size="30" value="" class="text-input">
<label class="error" for="desc" id="desc_error">Description is required.</label>

<label for="income" id="income">Income</label>
<input type="text" name="income" id="income" size="30" value="" class="text-input">
<label class="error" for="income" id="income_error">Income field is required.</label>

<label for="expend" id="expend_label">Expend</label>
<input type="text" name="expend" id="expend" size="30" value="" class="text-input">
<label class="error" for="expend" id="expend_error">Expend field is required.</label>
<label class="error" for="expend" id="combine_error1">In Income and Expend field, one field is required.</label>
<label class="error" for="expend" id="combine_error2">In Income and Expend field, only one field is required.</label>

    <br />  
    <input type="submit" name="submit" class="button" id="submit_btn" value="ok" />

the jquery file form.js-

$(function() {
     //validate and process from here

        var name=$("input#namee").val();
          return false;

         var description=$("input#desc").val();
              return false;

          var income=$("input#income").val();
          var expend=$("input#expend").val();
          if(income=="" && expend=="")
           if(income!="" && expend!="")

      var dataString='name='+namee+'&description='+description+'&income='+income+'&expend';
        type: "POST",
        url: "process.php",
        data: dataString,
        success: function() {
          $('#contact_form').html("<div id='message'></div>");
          $('#message').html("<h2>Transaction Saved</h2>")
           $('#message').append("<img id='checkmark' src='images/check.png'/>");
       return false;

In this form if i submit form with blank fields then only description field error is showing.I need if a person submit the form with both income and expend field or leave both blank then it should show errors(combine_error1 or combine_error2).but it is not working.

I have corrected my code.only values from dropdown is not going to process.php file.

This question has already been answered. Start a new discussion instead.