Need help with the change function
Hey Guys. I have wrote a script that hides to 3 input fields when the drop down "Cash" has been selected. It drop down gets removed but the values are still being grabbed by the POST variables. I would like to completly remove them not only hide.
I have looked into the remove function and when I have appended the remove function my fields didn't hide at all. Only hides with show and hide.
Do you guys have any ideas on how to make this work.. ??? I would really appreciate it. Thanks!
Below is my code.
{ $("#payment_method").change(function() {
if($(this).val() == "Cash"){
- // I would like to hide and remove the following fields.
$("#credit_card_number, #card_expiry_month, #card_expiry_year, #expiration_date")hide..remove();
} else {
$("#credit_card_number, #card_expiry_month, #card_expiry_year, #expiration_date").show();}
}
});