CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Hiding the Calendar date picker depending on selection

Print topic Send  topic

Author Message
robn

Posts: 70
Posted: 12/13/2005, 2:43 AM

I've been trying to find a way to hide the Date picker depending on the selection of a tick box (Boolean), what I want to do is hide the date picker if the tick box is not selected, but as soon as the box is ticked (given a value of 1) I want the date picker to be displayed so a date can be associated with the field. I tried the following Java code just to try and disable the date picker but it failed
function Status_OnChange()   
{  
if (document.tblQualSoftSupport.Client.value ==0) {  
  
	document.tblQualSoftSupport.DatePicker_ImpDate.disable = True;  
}  
else if (document.tblQualSoftSupport.Client.value !="") {  
  
		document.tblQualSoftSupport.DatePicker_ImpDate.disable = false;  
		}  
  
}

Has anyone else tried to do this with success? or has any ideas on how best to try and hide the Date picker? any help would be greatly appreiciated.

Kind regards

Rob
View profile  Send private message
matheus

Posts: 386
Posted: 12/13/2005, 2:45 AM

Use the datepicker image inside a <div> and change style display from this div.
_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
robn

Posts: 70
Posted: 12/13/2005, 2:56 AM

Hi Matheus

many thanks for the quick response, I'm afraid I am unsure of what you mean (or how to do this) is there any chance you could send me an example or explain more.

many thanks

Rob
View profile  Send private message
matheus

Posts: 386
Posted: 12/13/2005, 5:53 AM

your code from datepicker seems like this:
  
<!-- BEGIN DatePicker DatePicker_ImpDate --><a href="javascript:showDatePicker('{Name}','{FormName}','{DateControl}');"><img src="./Styles/Basic/Images/DatePicker.gif" align="center" border="0" /></a><!-- END DatePicker DatePicker_ImpDate -->  

before the image from datepicker use a div:
  
<div id="splash_datepicker" style="display: inline;" >  
<!-- BEGIN DatePicker DatePicker_ImpDate --><a href="javascript:showDatePicker('{Name}','{FormName}','{DateControl}');"><img src="./Styles/Basic/Images/DatePicker.gif" align="center" border="0" /></a><!-- END DatePicker DatePicker_ImpDate -->  
</div>  
  

In your function Status_On_Change you change display from div. Something like this:
  
function Status_OnChange()     
{    
if (document.tblQualSoftSupport.Client.value ==0) {    
    
	document.getElementById("splash_datepicker").style = "display: none";  
}    
else if (document.tblQualSoftSupport.Client.value !="") {    
                document.getElementById("splash_datepicker").style = "display: inline";  
		}    
    
}  

Didn't test this code, but this is the idea.
_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
robn

Posts: 70
Posted: 12/13/2005, 8:30 AM

That Great Matheus many thanks once again, I added the div code fine, and had to very slightly tweek the Java code to get it to work so in now looks like this
function Status_OnChange()       
{      
if (document.tblQualSoftSupport.ImpYN.checked == false) {      
      
        document.getElementById("splash_datepicker").style.display="none";    
}      
else if (document.tblQualSoftSupport.ImpYN.checked == true) {      
        document.getElementById("splash_datepicker").style.display="inline";    
                }      
      
} 

This works great many thanks for you help again

Rob
View profile  Send private message
DonB
Posted: 12/18/2005, 7:52 AM

Depending on your particular html structure, you might want to user
visibility: hidden instead of display: none, to retain the 'space' that the
calendar image occupies. This might make the difference between seeing a
nicely aligned column or one that zigzags, because of the fact display:none
completely 'collapses' the <div> content and visibility: hidden does not.

--
DonB

http://www.gotodon.com/ccbth


"robn" <robn@forum.codecharge> wrote in message
news:2439ef717a6127@news.codecharge.com...
> That Great Matheus many thanks once again, I added the div code fine, and
had to
> very slightly tweek the Java code to get it to work so in now looks like
this
>
function Status_OnChange()  
> {  
> if (document.tblQualSoftSupport.ImpYN.checked == false) {  
>  
>         document.getElementById("splash_datepicker").style.display="none";  
> }  
> else if (document.tblQualSoftSupport.ImpYN.checked == true) {  
>  
document.getElementById("splash_datepicker").style.display="inline";  
>                 }  
>  
> } 
>
> This works great many thanks for you help again
>
> Rob
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

ramesh
Posted: 01/12/2006, 10:45 PM

hello i want call jdatepick.js from jsp

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.