dotnetspider.com
Login Login    Register      

TutorialsForumCareer DevelopmentResourcesReviewsJobsInterviewCommunitiesProjectsTraining

Subscribe to Subscribers
Talk to Webmaster
Tony John

Facebook
Google+
Twitter
LinkedIn
Online MembersGaurav Arora
More...
Join our online Google+ community for Bloggers, Content Writers and Webmasters




Resources » TypeScript » Scripting Languages » Javascript

Create Multiple calender control on runtime time


Posted Date:     Category: Javascript    
Author: Member Level: Gold    Points: 20


Hi, If you want to create an unlimited calender control with textbox. try to my code. if you want to that user can enter multiple dates on single page as per over requirement. we can done do this using javascript. when user click on create button a texbox and calender button will be created. user can delete all control by single click on remove button.



 


On .aspx page


<script language="JavaScript" src="calendar.js"></script>
<link rel="stylesheet" href="calendar.css">





<form name="test">
<div id="container">
</div>
<input type="Button" onclick="f_createContent()" value="Create" />
<input type="Button" onclick="removeContent()" value="Delete" />


<script language="JavaScript">
var CALNUM = 1;
function f_createContent() {
var e_div = f_getElement('container');
e_div.innerHTML += CALNUM
+ '. <input type="text" name="testinpt' + CALNUM + '" value="" />'
+ '<img title="Open Calendar" class="tcalIcon" onclick="A_TCALS[\'CalID' + CALNUM + '\'].f_toggle()" id="tcalico_CalID' + CALNUM + '" src="img/cal.gif"/><br />';

new tcal ({
// form name
'formname': 'test',
// input name
'controlname': 'testinpt' + CALNUM,
// set unique ID to identify the elements
'id': 'CalID' + CALNUM
});

CALNUM++;
}
function removeContent() {
var e_div = f_getElement('container');
e_div.innerHTML = '';
window.A_TCALS = null;
window.A_TCALSIDX = null;
CALNUM = 1;
}
</script>
</form>

Attachments
  • class file for mulitiple calender (44084-24530-class-file-mulitiple-calender.css)
  • javascript for calender (44084-24417-javascript-calender.js)

    snap shot of multiple ...





  • Did you like this resource? Share it with your friends and show your love!


    Responses to "Create Multiple calender control on runtime time"

    No responses found. Be the first to respond...

    Feedbacks      

    Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: How to select and unselect checkbox using Java script
    Previous Resource: How to block special characters in a TextBox?
    Return to Resources
    Post New Resource
    Category: Javascript


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    Runtime calender by javascript  .  Create calender by javascript  .  



    Follow us on Twitter: https://twitter.com/dotnetspider

    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Email subscription
  • .NET Jobs
  • .NET Articles
  • .NET Forums
  • Articles Rss Feeds
    Forum Rss Feeds


    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    Revenue Sharing sites   Advertise   Talk to Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.