1

Good Day all,

I want to use datepicker to show the user particular dates that an event falls on. My game plan is to use datepicker as inline, show that it always shows and to pass the high lighted dates to it. My question is, how can I hide the input box, so the user only sees the calendar? Alternatively, the user could click a button to show the calendar, but I don't want them to be able to select a date.

Thanks Mike

rocketman889
  • 13
  • 1
  • 5

6 Answers6

3

this helps:

.ui-input-datebox { width: 40px; border: 0; background: transparent; padding: 0;margin: 0; box-shadow: none;}
.ui-input-datebox input {display: none;}
2

with data-option "hideInput": "true" (see http://dev.jtsage.com/jQM-DateBox/demos/fullopt.html and then the "Display Options"-Accordion-Tab)

<input name="mydate" id="mydate" type="date" data-role="datebox" data-options='{"mode": "calbox", "hideInput": "true"}' />
algorhythm
  • 8,530
  • 3
  • 35
  • 47
1

It can be done like that:

HTML

<a href="#" id="date-trigger" data-role="button" data-icon="grid" data-iconpos="noText" >28/08/2013</a>

<input data-role="datebox" data-options='{"mode": "calbox", "hideInput": "true", "noButton": "true"}' name="date" id="date" type="date" value="28/08/2013">

JS

$('#date-trigger').on( 'click', function(){
    $('#date').datebox('open');
});

Using Datebox2, see http://dev.jtsage.com/jQM-DateBox2/demos/opt/open.html.

David

Daweb
  • 11
  • 3
1

Here is the good answer.

<input id="date-id" name="date" type="text" data-role="datebox" data-options='{"mode":"calbox", "hideInput": "true", "hideButton": "true", "useInline": "true"}'>

Stephane
  • 11,056
  • 9
  • 41
  • 51
  • 1
    Welcome to Stack Overflow. When answering with code, please take the time to write a paragraph or two, explaining your solution. – afsantos Oct 26 '14 at 18:06
1

Apparently I didn't get around to documenting this one - useInlineHideInput: true should do it. I think it's dependent on useInline being true as well.

J.T.Sage
  • 1,984
  • 14
  • 21
0

You can hide the input box using following code:

<div style="display: none;">
<input name="mydate" id="mydate" type="date" data-role="datebox" data-options='{"mode": "calbox", "calTodayButton": true}'>
</div>
Mustafa Temiz
  • 326
  • 1
  • 4
  • 19