Sunday, 15 July 2012

jquery - Multiple controls using the same javascript -


I have a jquery calendar in which the js files are stored in the calendar folder. When I select the date, the date is inserted into a textbox. It's working fine. But I have another textbox and I want to use the same script and function for the same box. I am new to jquery, so help me with this one here is scripting:

  & lt; Head & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Link href = "calendar / jquery-ui.theme.css" rel = "stylesheet" /> & Lt; Script src = "// code.jquery.com/jquery-1.10.2.js"></script> & Lt; Script src = "calendar / jquery-ui.js" & gt; & Lt; / Script & gt; & Lt; Link href = "calendar / jquery-ui.css" rel = "stylesheet" /> & Lt; Script & gt; $ (Function () {$ ("# date picture"). DatePicker ();}); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; TR & gt; & Lt; Td class = "unmaintable1" & gt; Registration started: & lt; / Td> & Lt; Td class = "unmaintable2" & gt; & Lt; Input type = "text" id = "datepicker" /> gt; & Lt; / Td> & Lt; Td class = "unmaintable3" & gt; Registration ends: & lt; Input type = "text" id = "datepicker0" /> gt; & Lt; / Td> & Lt; Td square = "unmountable 4" & gt; & Amp; Nbsp; & Lt; / Td> & Lt; / TR & gt;  

I know that this is something to do with ID, but I'm not sure how to solve it. Thanks in advance.

"false">

  & Lt; Head & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Link href = "calendar / jquery-ui.theme.css" rel = "stylesheet" /> & Lt; Script src = "// code.jquery.com/jquery-1.10.2.js"></script> & Lt; Script src = "calendar / jquery-ui.js" & gt; & Lt; / Script & gt; & Lt; Link href = "calendar / jquery-ui.css" rel = "stylesheet" /> & Lt; Script & gt; $ (Function () {$ ("datepicker") Datepicker ();}); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; TR & gt; & Lt; Td class = "unmaintable1" & gt; Registration started: & lt; / Td> & Lt; Td class = "unmaintable2" & gt; & Lt; Input type = "text" class = "datepicker" id = "datepicker" /> gt; & Lt; / Td> & Lt; Td class = "unmaintable3" & gt; Registration ends: & lt; Input type = "text" class = "datepicker" id = "datepicker0" /> gt; & Lt; / Td> & Lt; Td square = "unmountable 4" & gt; & Amp; Nbsp; & Lt; / Td> & Lt; / Tr & gt;  


No comments:

Post a Comment