<script type="text/javascript">
$(document).ready(function() {
$("#credit_pay").hide();
$("#downpayment_method").change(function() {
if ($("#downpayment_method").val()=='credit_card') {
$("#credit_pay").show("fast");
} else {
$("#credit_pay").hide("fast");
};
if ($("#downpayment_method").val()=='e_check') {
$("#e_pay").show("fast");
} else {
$("#e_pay").hide("fast");
};
});
});
</script>
<tr>
<td>
<label for="downpayment_method">Downpayment Method</label>
<select id="downpayment_method" name="downpayment_method" >
<option value="" selected="selected"></option>
<option value="credit_card">Credit Card</option>
<option value="e_check">E-check</option>
</select>
</td>
</tr>
The above code i wrote works great on http://jsfiddle.net/gDtFS/ :
But it does not work in my server.
In firefug it shows the following in red:
$
DP_jQuery_1328833882393
jQuery
I cannot comprehend what the above means.
I have included the following files:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" type="text/javascript"></script>
Is there anything I am missing?
<div id="credit_pay">
<tr>
<td>
<label for="name_on_card">Name on Card</label>
<input type="text" name="name_on_card">
<label for="billing_zip">Billing Zip</label>
<input type="text" name="billing_zip">
</td>
</tr>
<tr>
<td>
<label for="card_type">Card Type</label>
<select id="card_type" name="card_type">
<option value="" selected="selected"></option>
<option value="Visa">Visa</option>
<option value="Mastercard">Mastercard</option>
<option value="Discover">Discover</option>
<option value="Amex">Amex</option>
</select>
</td>
</tr>
</div>
<div id="e_pay">
<tr>
<td>
<label for="name_on_account">Name on Account</label>
<input type="text" name="name_on_account">
</td>
</tr>
<tr>
<td>
<label for="routing_no">Routing #</label>
<input type="text" name="routing_no">
</td>
</tr>
<tr>
<td>
<label for="account_no">Account #</label>
<input type="text" name="account_no">
</td>
</tr>
</div>
Here is a live link
As mentioned by Craig it was the
<tr>tag that was creating the problemI removed the tables and just used css.
Here is the updated link.