View Single Post
Old 12-09-2012, 04:26 AM   PM User | #1
DSchragg
New to the CF scene

 
Join Date: Nov 2012
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
DSchragg is an unknown quantity at this point
Javascript to target specific form name?

I have a form that loads with the following hidden field:
Code:
<input type="hidden" name="packageID" value="1" />
This value can be either a 1 or 4 depending on what group you are part of on the site, however the form doesn't change.

What I want to do is customize the form a bit based on the value using something like this:
Code:
    var package = document.getElementsByName("packageID"); 
    if(package.value == '1'){
    $("#field_price_current_wrapper").hide();

    }else{

    if(package.value == '4'){
    }
}
I'm loading this in my footer after the form but it just isn't working, I'm hoping someone can tell me where I went wrong?

Thanks!
DSchragg is offline   Reply With Quote