jQuery - multiDatesPicker using an image or text?

Hi,
can anyone tell me how I can call the multiDatesPicker using an image or text?

http://multidatespickr.sourceforge.net/


Thanks,

Andrew

<script type="text/javascript" src="/multidatepicker/jquery-ui.multidatespicker.js"></script>
<script type="text/javascript">
			$(function() {
	 	
				$('#dates_closed1').multiDatesPicker({
				addDates : ['01/02/2015','03/03/2015','03/04/2015','04/04/2015','22/04/2015','23/04/2015','01/05/2015','06/06/2015'],
				dateFormat: "dd/mm/yy"
				});
				
			});
// -->

</script>
 
           
           
           <div class="inputname_fullwidth">Dates Store Closed - Click calendar icon to add or remove dates&nbsp;&nbsp;<img src="/images/calendar.gif"></div>
           <div class="inputname_fullwidth">
		   <input type="text" name="dates_closed1" id="dates_closed1" style="width:810px;border:0px;background-color:#f3f3f3;padding:2px" readonly>
</div>

Open in new window

sabecsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Robert SchuttSoftware EngineerCommented:
Don't add the image to your HTML mark-up manually, it will be added by the plug-in when you add the options "showOn" and "buttonImage" like below:
<script type="text/javascript">
  $(function() {

    $('#dates_closed1').multiDatesPicker({
      showOn: 'button',
      buttonImage: '/images/calendar.gif',
      addDates : ['01/02/2015','03/03/2015','03/04/2015','04/04/2015','22/04/2015','23/04/2015','01/05/2015','06/06/2015'],
      dateFormat: "dd/mm/yy"
    });
    
  });
// -->

</script>

Open in new window


It works with the text field as well (unless you add the option buttonImageOnly: true but I left that out), so if it doesn't work for you I'm wondering if you added the needed libraries?
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

Open in new window


Live example here: http://schutt.nl/ee/Q_28649412/

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sabecsAuthor Commented:
Thanks Robert, very much appreciated,  that is perfect.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.