Determining the visibility of an HTML element on the server side

If an HTML element like an input field is hidden under CSS visibility, eg. Display: No. Can I tell the server side if this element is hidden from it. And if so, how?

+2


source to share


1 answer


The short answer is, "No, you can't."

Long answer: if you are absolutely sure that the visibility of this element can only be changed with CSS, then you can parse all applicable CSS files. It's quite difficult, but possible.



However, in real life, you also need to know the exact version of the browser (due to possible CSS hacks and hence differences in behavior), and it is not uncommon for the visibility of elements to switch via javascript.

Update (based on OP's clarification): I would strongly suggest using hidden field ( <input type="hidden">

) to define visibility as you described. The hidden field value can be changed with javascript as the radio group value changes.

+1


source







All Articles