Sunday, 29 September 2013

Couldn't find the error in Ajax

Couldn't find the error in Ajax

I'm the dumbo back again with a silly question. I spent more than 6 hrs,
but couldn't find where the problem is.
Can you please help me solving this?
<form>
<select name="pmethod" id="pmethod">
<option value="">- Please Select -</option>
<option value="deposit">Deposit a Cheque at a local ICICI Bank</option>
<option value="transfer">Online Transfer by using your Net Banking
Account</option>
<option value="courier">Courier/Hand Deliver a "Payable At Par in Mumbai"
Cheque</option>
</select>
<div id="chqdetails" class="hide">
<input type="text" name="chqdetails" id="chqdetails" value="" size="60" >
<span id="chqdetailserror" class="etext"><br>Please provide cheque
details.</span>
</div>
<div id="trdetails" class="hide">
<input type="text" name="trno" id="trno" value="" size="60">
<span id="trnoerror" class="etext"><br>Please provide Transaction ID</span>
</div>
<div id="codetails" class="hide">
<input type="text" name="cochqdetails" id="cochqdetails" value="" size="60">
<span id="codetailserror" class="etext"><br>Please provide cheque
details.</span>
</div>
<div id="submitbutton" class="hide"><input type="submit" name="submit"
value="Submit Order"></div>
</form>
JSFiddle
The problems are:
When Deposit option is selected, neither it shows the error msg (if
blank), nor it shows the submit button if text is inserted.
Surprisingly, if Transfer is selected, the error msgs are displayed
properly, and the submit button if text is entered.
If Courier method is selected, it doesn't show the input box at all!!
Where am I doing wrong?
Thanks for your time and help.

No comments:

Post a Comment