Dang it.  This is not going to work for me.  I have a check box.
 If the check box is checked, I have some javascript looking for
the click event.  If the check box has a .checked = true.  I
change div's display value to block, else to none.  So, you
check the check box and some radio buttons show up, else they
disappear.

If I put the hidden field, then the javascript returns an
undefined value.  Any ideas on how to solve this.  Here is what
the html looks like:

<input type="checkbox" name="recordTypebooking" value="true"
checked="checked" onclick="javascript:bookingBoxDisplay();">
Bookings <br />
<input type="hidden" name="recordTypebooking" value="false">
        
            
<script type="text/javascript" language="JavaScript">
<!--
   function bookingBoxDisplay(){
      if (document.searchNameForm.recordTypebooking.checked) {
       
document.getElementById('bookingBox').style.display='block';
      } else {
       
document.getElementById('bookingBox').style.display='none';
      }
   }
// -->
</script>
                
<span id="bookingBox" class="leftPad15" style="display:block;">
   <input type="radio" name="recordTypebookingValue" value="all"
checked="checked"> All <br />
   <input type="radio" name="recordTypebookingValue"
value="incarcerated"> Incarcerated Only
</span>

            
--- Norris Shelton <[EMAIL PROTECTED]> wrote:

> Now I see clearer what you were saying.  I found this in the
> java forums.
> 
>
http://forum.java.sun.com/thread.jspa?threadID=242031&messageID=2946045
> 
> It worked like a charm.
> 
> I wonder why the html:checkbox docs don't mention this.
> 
> Thanks for your help.
> 
> --- Cédric Levieux <[EMAIL PROTECTED]> wrote:
> 
> > Because when you uncheck a checkbox you don't send this
> field
> > and the
> > form process let the previous value in place
> > 
> > One of tips of mine is to put a hidden field with the same
> > name and to
> > see the field as an array : when it contains only one value
> > the
> > checkbox is unchecked, checked otherwise
> > 
> > Hope it will help,
> > 
> > Cedric
> > 
> > 
> > On Tue, 8 Feb 2005 13:58:22 -0800 (PST), Norris Shelton
> > <[EMAIL PROTECTED]> wrote:
> > > I have a checkbox drawn by:
> > > <html:checkbox property="recordTypebooking"
> > >     onclick="javascript:${recordType.name}BoxDisplay();"
> />
> > > ${recordType.description} <br />
> > > 
> > > The form is defined as:
> > > <form-bean name="searchNameForm"
> > > type="org.apache.struts.validator.LazyValidatorForm" >
> > >     ...
> > >     <!-- default recordTypeBooking to booking -->
> > >     <form-property name="recordTypebooking"
> > > type="java.lang.Boolean" initial="true"/>
> > >     ...
> > > </form-bean>
> > > 
> > > The check box displays correct and even defaults.  If I
> > uncheck
> > > the box and submit, when it failes validation, it is still
> > > checked.
> > > 
> > > =====
> > > 
> > > Norris Shelton
> > > Software Engineer
> > > Sun Certified Java 1.1 Programmer
> > > Appriss, Inc.
> > > ICQ# 26487421
> > > AIM NorrisEShelton
> > > YIM norrisshelton
> > > 
> > > __________________________________
> > > Do you Yahoo!?
> > > Meet the all-new My Yahoo! - Try it today!
> > > http://my.yahoo.com
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > 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]
> > 
> > 
> 
> 
> =====
> 
> Norris Shelton
> Software Engineer
> Sun Certified Java 1.1 Programmer
> Appriss, Inc.
> ICQ# 26487421
> AIM NorrisEShelton
> YIM norrisshelton
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection
> around 
> http://mail.yahoo.com 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


=====

Norris Shelton
Software Engineer
Sun Certified Java 1.1 Programmer
Appriss, Inc.
ICQ# 26487421
AIM NorrisEShelton
YIM norrisshelton


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to