javascript confirm not working properly with kendo mobile ui - kendo-ui

On Ipad or Iphone when I click on cancel in confirmation box ,after cancel touching tab or phone screen again prompts that confirmation box .
Here is my code
<div data-role="view" id="message" data-title="Message" data-layout="default">
<a data-click="closeModalViewLogin" data-role="button" data-align="right">Close</a>
</div>
here is my javascript code
<script>
function closeModalViewLogin()
{
return confirm("Are u sure?")
}
</script>
Please give some suggession

If you are using Phonegap then you can use
notification.confirm(....)

This is a known issue, unfortunately. Launching browser alert and confirm dialogs messes up the events sequence, resulting in the problem you experience. A common workaround we suggest is to wrap the confirm call in a setTimeout.

Related

How to auto refresh a page on an embedded google form submit

Note upfront: I do not have any experience using scripts but only some basic HTML and PHP skills.
I would like a page on my google site to refresh automatically as soon as the embedded google form was submitted. This to instantly display the embedded and updated google form results after the button is clicked without the visitor having to reload the page manually. (like you would have for any online poll)
My form sheet is updating perfectly but I have not yet found an example or tutorial how to make a page refresh work for the google site with an embedded google form when the submit button is clicked. I hope someone can help me by providing an example on how to make this work. Preferably I would like to use an embedded google form rather than having to create a separate PHP form loading into google forms what could be an alternative. Thanks.
Below the HTML as I can see it on my Google page. I would need a trigger I guess from these embedded forms to refresh the page on submit. I just have no idea on how to get this done.
<div>
<div style="text-align:left">
<div><img src="https://www.google.com/chart?chc=sites&cht=d&chdp=sites&chl=%5B%5BSpreadsheet+form'%3D20'f%5Cv'a%5C%3D0'10'%3D499'0'dim'%5Cbox1'b%5CF6F6F6'fC%5CF6F6F6'eC%5C0'sk'%5C%5B%22test+int+sheet%22'%5D'a%5CV%5C%3D12'f%5C%5DV%5Cta%5C%3D10'%3D0'%3D500'%3D397'dim'%5C%3D10'%3D10'%3D500'%3D397'vdim'%5Cbox1'b%5Cva%5CF6F6F6'fC%5CC8C8C8'eC%5C'a%5C%5Do%5CLauto'f%5C&sig=5VZGSIULBu8sSdf833qiLWVDcx8" data-origsrc="1VACx4d2pJEZlvAezbO9Gnh_nX3nIPwSJ4iCNjEmCiUM" data-type="spreadsheet-form" data-props="align:center;borderTitle:test int sheet;doctype:freebird;height:400;objectTitle:test int sheet;showBorder:false;showBorderTitle:false;wrap:false;" width="500" height="400" style="display:block;margin:5px auto;text-align:center;"></div>
<br>
</div>
<div style="text-align:left"><img src="https://www.google.com/chart?chc=sites&cht=d&chdp=sites&chl=%5B%5BGoogle+Gadget'%3D20'f%5Cv'a%5C%3D0'10'%3D499'0'dim'%5Cbox1'b%5CF6F6F6'fC%5CF6F6F6'eC%5C0'sk'%5C%5B%22Include+gadget+(iframe)%22'%5D'a%5CV%5C%3D12'f%5C%5DV%5Cta%5C%3D10'%3D0'%3D500'%3D397'dim'%5C%3D10'%3D10'%3D500'%3D397'vdim'%5Cbox1'b%5Cva%5CF6F6F6'fC%5CC8C8C8'eC%5C'a%5C%5Do%5CLauto'f%5C&sig=t6_Deqv8rgMQCB28aqz1n9MoVTU" data-igsrc="http://164.gmodules.com/ig/ifr?mid=164&synd=trogedit&url=http%3A%2F%2Fhosting.gmodules.com%2Fig%2Fgadgets%2Ffile%2F106581606564100174314%2Fiframe.xml&up_iframeURL=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1g2cGeavUciTy6po7_DXPXMNqC1fqTTROHRoTnsafFfM%2Fpubhtml%3Fgid%3D754672963%26single%3Dtrue&up_scroll=no&h=400&w=100%25" data-type="ggs-gadget" data-props="align:center;borderTitle:Include gadget (iframe);height:400;igsrc:http#58//164.gmodules.com/ig/ifr?mid=164&synd=trogedit&url=http%3A%2F%2Fhosting.gmodules.com%2Fig%2Fgadgets%2Ffile%2F106581606564100174314%2Fiframe.xml&up_iframeURL=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1g2cGeavUciTy6po7_DXPXMNqC1fqTTROHRoTnsafFfM%2Fpubhtml%3Fgid%3D754672963%26single%3Dtrue&up_scroll=no&h=400&w=100%25;mid:164;scrolling:no;showBorder:false;showBorderTitle:null;spec:http#58//hosting.gmodules.com/ig/gadgets/file/106581606564100174314/iframe.xml;up_iframeURL:https#58//docs.google.com/spreadsheets/d/1g2cGeavUciTy6po7_DXPXMNqC1fqTTROHRoTnsafFfM/pubhtml?gid=754672963&single=true;up_scroll:no;view:default;width:100%;wrap:false;" width="500" height="400" style="display:block;margin:5px auto;text-align:center;" class="igm"></div>
<div style="text-align:left"><br>
</div>
<div style="text-align:center">
<div></div>
<br>
</div>
<div style="text-align:left">
<div style="text-align:center"><br>
</div>
<div style="text-align:center"><br>
</div>
<br>
</div>
</div>
I'm sorry to be the annunciator of a such bad news but that's impossible.
As your code show, you are actually using a google Site to display your google form. The line:
<img src="https://www.google.com/chart?chc=sites&cht=d&...
IS the way google tell you there is a google form in this page when you hit the button to get the source code.
In other words: google don't let you put whatever you want in a google site. It's impossible to add some JS code that will be fired when the user submit the form.
Even if you host your form in something else than a google Site, you won't have this ability, as the form himself will be displayed in an iframe that can't be modified by external scripts.
This is an hard limitation of Google Form, the only workaround that you may use is to write to the user in the confirmation message of the form that he now need to reload the page or go to an other link.

Trigger click on link on jquery mobile not working

I tried triggering a link via .trigger() function but is not working
<a data-role="button" id="redirectprofile_btn" href="profile.html" rel="external" style="display:block;">Profile</a>
Once i click the link manually, it will display the profile page (profile.html, with its own css and js) but if i use
$("#redirectprofile_btn").click() or $("#redirectprofile_btn").trigger('click'),
it wont redirect.
Im new to jquerymobile, any help would really be great.
Thanks
Use event.prevent default() followed by event.stopImmediatePropogation then changePage to the links href attr value.

Posting to iframe works in Chrome but not IE or FF

I have a page with a container that gets different content from an ajax request. This content has a form that posts data (and a file) to an iframe that is also in this ajax content container. I can submit the form and it works perfectly in Chrome, but Firefox and IE just sit there like I never clicked the submit button. I have default security settings on each browser, and don't want to change them for this functionality. Can anyone see any bugs in my code or process that would cause this? thanks in advance!
form:
<form action='processUploadFrame.php' method='post' enctype='multipart/form-data' id='myForm' target='iframeUpload'>
<input type='submit' value='Upload' />
iframe:
<iframe name='iframeUpload' frameborder=1 width=750 height=150></iframe>
Solved. My HTML 101 has failed me. Having my submit button in a different table cell than the rest of the form doesn't work in IE and FF, but Chrome is okay with it. Strange. A simple javascript submit link did the trick:
<a href='javascript:document.getElementById(\"myForm\").submit();'>Submit</a>
Here's an article that reminded me about the rules of such: http://www.cs.tut.fi/~jkorpela/forms/tables.html

dojo.connect not working in IE but sometimes in chrome&firefox

I finally got some parts working here: http://jsfiddle.net/trXBr/5/
but when I put the code back into my project and tried to browse using internet explorer; the button onclick events do not work. Interestingly the one button onclick function to show the dialog works in firefox and chrome. I was excited to have this working in the editor but now if this does not work with all browsers, then this is just really frustrating. I am using version 1.5.1
dojo.connect(loadBtn,'onClick',function(){
userDialog.show();
});
dojo.connect(butt,'onClick',function(evt){
showTab();
});
Any help/ideas appreciated.
EDIT:
Ok using the compatibility mode in IE helps to get the one function working which displays the dialog box.
So as you can see here I have an borderlayout where I want a tabcontainer to be displayed in the middle with a click of a button and this works fine in jsfiddler but not from my code in the browsers;
<div dojoType="dijit.layout.ContentPane" region="center" splitter="true">
<div id="mainTabContainer"dojoType="dijit.layout.TabContainer"
style="width:500px;height:100px;display:none">
<div id="tab1" dojoType="dijit.layout.ContentPane"
title="First Tab" selected="true"
closable="true">First Tab</div>
<div id="tab2" dojoType="dijit.layout.ContentPane"
title="Second Tab" closable="true">
Second Tab
</div>
</div>
</div>
so the display:none but when I click the button I call the following:
dojo.connect(butt,'onClick',function(evt){
showTab();
});
function showTab(){
dijit.byId("mainTabContainer").domNode.style.display = 'block'
dijit.byId("mainTabContainer").resize();
}
Also if I remove the display=none then the tabcontainer appears fine. So is these something wrong with my function call.
ok sorry guys....all my fault here...I forgot to remove the added code I had in my html in my asp.net code
<body class="claro">
<form id="form1" runat="server">
<asp:ScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ScriptManager>
Once I removed the form and scriptmanager lines it works fine..Thanks for everyones efforts.
Just worried that if I were to incorporate ajax and other controls, then would dojo still work

FireFox: strange behavior on submiting a form

Can anyone help with this strange form submiting in FireFox?
So this form should be submitted after pushing "go to submit" button. There is an onclick event on the button that should submit form through JavaScript. In the form there is another button "test" without any onclick event. Following the script, the form should be submitted only after pushing the "go to submit" button, but it submits even pushing at "test" button.
In the Internet Explorer it works well! But this stupid FireFox browser behaves different.
Here is example of HTML page:
<script>
function func(){
document.form1.submit();
}
</script>
<form name="form1" method="post" action="somewhere.php">
<button>test</button>
<input type="button" value="go to submit" onclick="func();">
</form>
I have several buttons with <button onclick="...">option 1</button> options. I want to fix strange submiting a form in FireFox. Help please!
http://www.w3schools.com/tags/tag_button.asp
The tag defines a push button.
Inside a button element you can put content, like text or images. This is the difference between this element and buttons created with the input element.
Always specify the type attribute for the button. The default type for Internet Explorer is "button", while in other browsers (and in the W3C specification) it is "submit".

Resources