I'd run an action when you click the radio button and regenerate the form, you'll have to manage this when setting the values that you know longer need.


The following with serve as some psuedo code to express what I mean.

<script langage="javascript" type="text/javascript">
        function toggle() {
                window.location = '<c:url value="/toggleElements.do" />';
        }
</script>
<html:radio property="myradio" onchange="toggle()" value="whatever" />
<noscript>
        <html:link page="/toggleElements.do">Toggle</html:link>
</noscript>
<c:if test="${showElements}">
        <html:text prop...
</c:if>
...

if(showElements == false) {
        showElements = true;
} else {
        showElements = false;
}

session.setAttribute("showElements", showElements);

...
showElements could also be used to control how the properties are set when submitted.


The other more painful road involves dhtml, that I'd be tempted by if I got the hideElements.do action running first. You'll never get the DHTML version working across the board quickly, perhaps worth entertaining such craziness if you know need to support ns4..

Cheers Mark



On Friday, October 24, 2003, at 06:02 PM, Mike Jasnowski wrote:

That's because of the behavior of the "visibility" property only indicates
that the div should be "visible|invisible", but not change it's dimensions
in the document I believe. That's why the space still appears occupied.


What I think you want is something more like the "display" property, which
indicates whether the div should occupy space in the document. Of course,
watch out for Netscape's treatment of this property.


That said, you might also look at changing the dimensions of the div as well
as setting visibility.


HTH,
Mike Jasnowski

-----Original Message-----
From: Jan Kester [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2003 12:43 PM
To: Struts Users Mailing List
Subject: RE: hide section of form


Thanks,


I did add DHTML and used DIV with visibility hidden and visibility visible.
Only, the submit buttons that come afterwards, remain in the same location.
That is, when the questions are hidden, the buttons are a far below in the
page.


Regards, Jan

-----Mensaje original-----
De: Rajat Pandit [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 24 de octubre de 2003 10:14
Para: 'Struts Users Mailing List'
Asunto: RE: hide section of form


Thoug a non struts related question, you might want to consider layers (DHTML) and make them visible or invisible. Try using dreamweaver. It has a good tool for making layers

-----Original Message-----
From: Jan Kester [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2003 12:59 AM
To: Struts Users Mailing List
Subject: hide section of form


Hello


how can I hide a section of my form with struts/javascript. That is,
someone presses a radio button and sees additional questions, presses
the opposite radio button and questions disappears. Without reloading
the form.

Regards, Jan


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to