I have a long form and depending on certain parameters, some fields may be hidden. I can either write this pseudocode:
if(input is hidden) {
<input type="hidden" ... />
}
else {
<input type="text" ... />
}
Or I could simply apply a style with display:none for the fields that I want to be hidden.
The latter is easier, but is there a reason why I would want to use type="hidden" input fields rather than invisible regular fields? Is the only issue that people without CSS would see them?
It depends on whether you are filtering output based on some condition such as a logged in user. If this is the case then go for the code in your pseudocode option such like
If you simply want a hidden field regardless use the html hidden input element