Forum Moderators: open

Message Too Old, No Replies

Determine visibility of element which is on a div thats shown/hidden?

         

hansem

8:13 am on Aug 26, 2005 (gmt 0)

10+ Year Member



Hi,

I'd like to determine if a form element is shown or hidden?

I have a form with several fields, some of which are only shown (required) when a select has a certain value, then the div which they or on is shown and so the elements are shown.

Is it possible to determine if the element is shown depending on the div/table/etc. on which it is is visible?

Thanks,
Marco

Scally_Ally

8:35 am on Aug 26, 2005 (gmt 0)

10+ Year Member



I think it might be something like this.

you would have your dropdown box which would be giving values like,
<select>
<option>value1</option>
<option>value2</option>
</select>
etc....

<script>
function showLayers(){
if (document.form.dropdownmenu.value == value1){
document.form.partYouWantVisible.visible = true;
}
}
</script>

you can then call this function on the onBlur of the select box so that when the user enters a value the function is called.

Hope that helps