Set the implementation code of the click Text Box or image pop-up calendar control, text box calendar

Source: Internet
Author: User

Set the implementation code of the click Text Box or image pop-up calendar control, text box calendar

<Input id = "startDate" value = "" readonly = "true" type = "text" style = "cursor: pointer "class =" user_datepicker "> <input class =" canlderImg "data-tag =" start "type =" image "src = ".. /.. /I/canlder1.png "> <span> end: </span> <input id = "endDate" value = "" readonly = "true" type = "text" style = "cursor: pointer; "class =" user_datepicker "> <input class =" canlderImg "data-tag =" end "type =" image "src = ".. /.. /I/canlder1.png ">

// Js Code

$ ("# StartDate "). datepicker (); $ ("# endDate "). datepicker (); // click the image to bring up the calendar control, you need to bind the click event to the image $ (. canlderImg ). on ("click", function (e) {var tagclustering (e.tar get ). attr ("data-tag"); if (tag = "start") {$ ("# startDate "). datepicker ("show");} else if (tag = "end") {$ ("# endDate "). datepicker ("show ");}});

The implementation code of the above settings by clicking the text box or image pop-up calendar control is all the content shared by xiaobian. I hope to give you a reference, and I hope you can also support the help house.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.