I'm trying to hide or show a div based on the value of some radio buttons, CSS displayed by default To div = 'none'
here is the input
& lt; Input type = "radio" id = "payment_type" value = "cash" check = "checked" name = "payment type" onchange = "showoffining financing (this .view);" /> and & amp; Nbsp; Cash / Debit & lt; Input type = "radio" id = "payment_type" value = "check" name = "payment_type" onchange = "showhideFinancing this.value)" /> Check & lt; Input type = "radio" id = "payment_type" value = "visa" check = "checked" name = "payment type" onchange = "showhide fanning (this.value);" / & gt; & Amp; Nbsp; Visa & lt; Input type = "radio" id = "payment_type" value = "mc" name = "payment_type" onchange = "showhide financing (this.value);" /> & Amp; Nbsp; MasterCard & amp; Lt; Input type = "radio" id = "payment_type" value = "financing" name = "payment_type" onchange = "showhide fining (this.value);" & Gt; & Amp; Nbsp; Financing
Here is the div:
My Javascript FN looks like this:
Showoffining (payment type) {if (payment_type == "financing") {document.getElementById ( "Financing") .style.display = 'block'; } And {document.getElementById ("Financing"). Style.display = 'none'; }}
Firebug shows that getElementById is not defined - thanks!
The only reason that can be assumed is that "getElementById" has not been defined Or if you create a typo in your original code that you did not sample (case sensitive is always one, I get it) or if you redefined the document somewhere else in the page.
Comments
Post a Comment