struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reshmi" <ra...@trinitymobility.com>
Subject RE: problem in hiding timepicker of struts jquery datetimepicker
Date Tue, 24 Apr 2012 12:46:30 GMT
Hi Hernán,

Thanks for your quick reply.

What my requirement is,
Based on the checkbox selection, I need to show/hide the timepicker of the
datetimepicker.




-----Original Message-----
From: Hernán [mailto:heamaya@gmail.com] 
Sent: Tuesday, April 24, 2012 6:10 PM
To: Struts Users Mailing List
Subject: Re: problem in hiding timepicker of struts jquery datetimepicker

As you are using struts2 jquery plugin, I would use jquery:

<script type="text/javascript">
$(
   function() {
       $("#selectId").change(
          var selectedValue = $(this).val();

          if(selectedValue == 'A') {
             $("#timePickerId").hide();
          }


       );
   }
);

</script>

Just use show() when you want to...
On Tue, Apr 24, 2012 at 9:33 AM, Reshmi <rasmi@trinitymobility.com> wrote:

>  Hi all,****
>
> My codes for date time picker is****
>
> ** **
>
> <sj:datepicker timepicker=*"true"* readonly=*"true"* label=*"From Date"*
> id=*"fromdate"* name=*"fromdate"* displayFormat=*"dd-mm-yy"*
> timepickerShowSecond=*"true"*  timepickerFormat=*"hh:mm:ss"*></
> sj:datepicker>****
>
>                         <sj:datepicker timepicker=*"true"* readonly=*
> "true"* label=*"To Date"* id=*"todate"* name=*"todate"* displayFormat=*
> "dd-mm-yy"* timepickerShowSecond=*"true"* timepickerFormat=*"hh:mm:ss"*
> ></sj:datepicker>****
>
> ** **
>
> ** **
>
> I want to display timepicker only for some cases****
>
> For that I put javascript function like this.****
>
> ** **
>
> ** **
>
> ** **
>
> *if*(select1=="A")****
>
>               {****
>
>              ****
>
> ** **
>
>               ****
>
>               document.getElementById("fromdate").timepicker=false;****
>
>               document.getElementById("todate").timepicker=false;****
>
>               }****
>
>         *else* ****
>
>               {****
>
>               ****
>
>               document.getElementById("fromdate").timepicker=*true*;****
>
>               document.getElementById("todate").timepicker=*true*;****
>
>               ****
>
>               }****
>
> ** **
>
> But this is not working for for me.Any one can help me?How can I implement
> it?****
>
> ** **
>
> *Best Regards,*
>
> *Reshmi***
>
> *Software Engineer | Trinity Mobility Pvt. Ltd. |
> Bangalore|+91-8971512535| ***
>
> [image: trinity-logo_small]****
>
> ** **
>
> ** **
>



-- 
Hernán


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message