If a HTML element such as an input box is hidden under a CSS visibility e.g. Display:None. Can I determine server-side whether this element is hidden of not. And if so, how?
+1
A:
The short answer is "no, you cannot".
The long answer is: if you are absolutely sure that this element visibility can only be altered via CSS you could parse all applicable CSS files. It's rather hard but possible.
However, in real life you also need to know the exact browser version (due to possible CSS hacks and thus difference in behavior) plus quite often element visibility is toggled via javascript.
Update (based on OP's clarification):
I would strongly suggest using a hidden field (<input type="hidden">
) in order to determine visibility as you've described. Hidden field value can be changed via javascript as radio group value changes.
ChssPly76
2009-09-03 16:26:44
Coincidentally, mooted this with a few other peeps. Without going into too much detail this is probably the only way I can achieve what I am looking for WITHOUT caring about the relationship between the radio button and repeating group server side (would require a tweak to the framework I am currently working with). Thanks for your time..
brumScouse
2009-09-03 18:46:07