Solved

Calendar control and PostBack issue

Posted on 2012-04-11
2
432 Views
Last Modified: 2012-04-12
I have a web form with a button (button1) and a div with dropdownlis, a bunch of texbox controls on it, a button(button2) and a calendar control.

The div and its elements are not visible until user clicks on button1 - the only control visible on the form. I use JQuery to make the div and its elements visible.

her is my JQuery code:

$(document).ready( function(){
	 $('#div1').css('display', 'none');
                 $('#button1').click(function(e){
	         e.preventDefault();
	         $('#div1').css('display', 'block'); 
	 });
 });

Open in new window


So when I click on button1, my div1 becomes visible, I select and item from a dropdown, then I click on a calendar control to select a value and my div becomes invisible. it reatins all the selections and re-appears if I click on button1 once again, but it is not satisfactory. I tried preventing a postback of calendar control but then it does not retain a selection in the calendar control.

How do i get around this issue?
0
Comment
Question by:YZlat
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 37837321
0
 
LVL 35

Author Comment

by:YZlat
ID: 37837677
UpdatePanel worked for me. Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question