Skip to content Skip to sidebar Skip to footer

HTML Input Popup Calendar Issue

I am trying to pop a calendar control when a user clicks on an input field. The calendar control is actually a div section for calendar which I am trying to toggle the display. The

Solution 1:

Try using this Javascript:

<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
//-->
</script>

And this HTML on your button that is toggling the calendar:

onClick="toggle_visibility('calendar');"

This simply displays/hides the div container with the ID of 'calendar'. You might have to put the calendar script itself inside your div, given that you don't need to pass variables to it via a control.


Post a Comment for "HTML Input Popup Calendar Issue"