How to set JQuery Mobile datebox popup at the center of window? - jquery-mobile

I'm using JQM datebox as following now:
<input name="startTime" id="startTime" type="text" data-role="datebox" data-options={"mode": "datebox"}>
But the datebox doesn't pop up at the center of window.
How can I to do it?

You can force the Position of the PopUp: http://dev.jtsage.com/jQM-DateBox/api/popupPosition/
Example 1 (http://jsfiddle.net/Twisty/6swq0t0k/1/):
<input name="startTime" id="startTime" type="text" data-role="datebox" data-options='{ "mode": "datebox", "popupPosition": "window"}' />
Example 2:
<input name="startTime" id="startTime" type="text" />
<script>
$("#startTime").datebox({
mode: "datebox",
popupPosition: "window"
});
</script>
This will force it to center in browser window. You can also center over another element by it's ID if you want.

Related

stop remember me popup in chrome using java-script

i want to stop popup remember me box in asp mvc (programmatically) i tried autocomplete=off place password text-box and set it hidden but no solution is working.
Tried
autocomplete="off"
Tried
<input type="password" autocomplete="off" />
Tried
<form id="loginForm" action="login.cgi" method="post" autocomplete="off">
Tried
<input style="display:none">
<input type="password" style="display:none">
None of this working please guide me

Angular app on IOS doesn't show me keyboard, when i click on input. Why?

My Angular application doesn't show me keyboard, when i click on input for the first time. Second click and other shows it.
I don't have ngTouch and any function on inputs.
<div class="input-wrapper">
<input type="email" name="login" tabindex="1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" ng-model="form.userData.login" placeholder="{{'LOGIN_OR_EMAIL' | translate}}" required>
</div>
Nothing special in html
if you have
-webkit-user-select:none;
user-select:none;
in your css remove them.

How to checked jquery mobile radio button set via code

I use jquery mobile for build a Phonegap application. I create any radio sets like this :
I want to checked a radio in a switch case!
switch (font_family){ case 'tahoma': $('#radio-1').checked(); ... }
Can you help me?
From the picture I am assuming you are using jQM version 1.3.x, however this solution works with 1.4.x too.
Assuming you have markup similar to this:
<fieldset data-role="controlgroup" data-type="horizontal">
<legend>Font:</legend>
<input type="radio" name="thefont" id="radio-1" value="arial" checked="checked" />
<label for="radio-1">Arial</label>
<input type="radio" name="thefont" id="radio-2" value="verdana" />
<label for="radio-2">Verdana</label>
<input type="radio" name="thefont" id="radio-3" value="tahoma" />
<label for="radio-3">Tahoma</label>
</fieldset>
The script to switch to Tahoma would be:
$("[name='thefont']").prop( "checked", false ).checkboxradio( "refresh" );
$("#radio-3").prop( "checked", true ).checkboxradio( "refresh" );
The first line unchecks all boxes and the second checks the tahoma box. In jQM you must refresh the checkboxradio widget after changing values.
DEMO

jquery mobile - datebox appears too much on the left

I'm using jQuery 1.7.2 and jqm-datebox 'stable'.
Code:
<label class="ui-input-text ui-hidden-accessible" for="date">Date</label>
<input jql id="date" class="ui-input-text ui-body-c ui-corner-all ui-shadow-inset" type="text" value="" name="date" data-role="datebox" data-options='{"mode": "calbox", "calStartDay": 1}'></input>
When I click on the little icon, though, the calendar box appears too much to the left, as in picture. This is particularly evident on a mobile device.
If I reduce the width of the window it goes even further left.
The element.style (especially the left attribute) appears to be calculated on the fly, depending on the width, but I can't manage to find where, neither in the css, nor in the js.
I saw this question, kinda similar to mine, but I don't find it applicable to my case.
How should I go to make the box show in its entirety?
From the docs:
<input name="mydate" id="mydate" type="date" data-role="datebox" data-options='{"mode":"calbox", "centerHoriz": true}'>
The centerHoriz option will get you what you want.

How to init data when use jquery ui?

I have one checkbox use jQuery UI
<input type="checkbox" id="checkbox_1" name="checkbox_1" value="1" />
<label for="checkbox_1" class="checked">checkbox_1</label>
<script>
$(function){
$("input:checkbox").button();
};
</script>
And I query the data from database,the checkbox should be checked.
But it doesn't works when I added the attribute of "checked" in checkbox like normal usage.
How to achieve it?
add in html
<input type="checkbox"checked="checked"id="checkbox_1" name="checkbox_1" value="1" />

Resources