Sunday, November 29, 2009

Html hidden field works in firefox but not IE?

I'm trying to remove this required 'terms%26amp;conditions' checkbox from a form and pass it as accepted by using a hidden field:



%26lt;input name="terms" id="terms" value="1" type="checkbox"%26gt;



%26lt;label for="terms"%26gt;I accept the %26lt;a href="terms.php" target="_blank"%26gt;terms %26amp; conditions%26lt;/a%26gt;%26lt;/label%26gt;



Commenting out the field and inserting the line below works in firefox, but I still get an alert in IE that says I haven't checked the box:



%26lt;input type="hidden" id="terms" name="terms" value="1" checked="true" /%26gt;



What code can I use that works in both browsers?



Thanks much!



Les



Html hidden field works in firefox but not IE?windows 2000





Okay, hidden fields are normally text fields and are intended to contain info you don't want the user to input. For example, here's one sample pulled from EchoEcho's tutorial site:



%26lt;div align="center"%26gt;



%26lt;input type="text" size="25" value="Enter your name here!"%26gt;



%26lt;input type="hidden" name="Language" value="English"%26gt;



%26lt;br%26gt;%26lt;br%26gt;



%26lt;/div%26gt;



So, that's probably issue one. Your trying to use checkboxes when hidden types are normally text. See if you can re-work your code to utilize a text box. If anything, simply have it contain either 'true' or 'false' depending on other input.



Hope this helps!



Html hidden field works in firefox but not IE?internet explorer internet explorer



All your example garners is a problem, with two input elements having the same id. Just place the checked="checked" in the original (the first one you listed...) input element, and the "accepted" value will be checked unless the page viewer specifies otherwise...

No comments:

Post a Comment

 
web hosting servers