I am trying to open a Dialogue Box On page load of jquery Mobile screen .Right now i am able to open Dialogue Box on button Click .I want the Dialogue box to get pop up automati
You can fire the click in your jquery code as
$('#simplestring').click();
Write this statement on page load. It will fire click from inside your code and as the click handler does, it will open the dialog :)
Try using $(document).ready(function(){})
$(document).ready(function()
{
$("#simplestring").simpledialog({
'mode' : 'string',
'prompt' : 'Please Enter Your Mobile No.',
'buttons' : {
'OK': {
click: function () {
$('#dialogoutput').text($('#dialoglink').attr('data-string'));
//get the Value Entered
//Create a Sqlite Database and table
//Insert it there
}
},
'Cancel': {
click: function () { },
icon: "delete",
theme: "c"
}
}
})
});
function onLoad()
{
openDialogBox();
document.addEventListener("deviceready", onDeviceReady, false);
$("#searchby_chooser_ok_button").bind ("click", searchByCriteria);
if (typeof Contact === "undefined") {
getElement("contacts_list").innerHTML = "<p>The Cordova Contacts API is inaccessible</p>";
}
}
function openDialogBox()
{
$("#simplestring").simpledialog({
'mode' : 'string',
'prompt' : 'Please Enter Your Mobile No.',
'buttons' : {
'OK': {
click: function () {
$('#dialogoutput').text($('#dialoglink').attr('data-string'));
}
},
'Cancel': {
click: function () { },
icon: "delete",
theme: "c"
}
}
})
}