I have found an issue with my site and I have isolated it to Jquery Mobile components. I am simply clicking a href link that calls another PHP page. On the second page I have set up a form and a Jquery form validation that checks to see if the SKU button has been selected and if so it should return an alert and cancel the form submission. The problem is that when I link to the second page from the first page the form validation code is not working.
If I refresh the page it works just fine. I isolated out the link to Jquery Mobile and the page works just fine. There is something that is being passed by Jquery Mobile that is keeping the page from loading in its entirety. Or, more likely there is some carry-over from the first page that disables the validation code on the second page.
I can add that if I get rid of the links to Jquery Mobile entirely on the second page (no styling at all) and I link to the second page from the first page, The Jquery Mobile formatting still carries to the second page. I have investigated this extensively and I can't find any previous mention of this problem. I have set up test pages to sort this out.
Page 1:
<html lang="en">
<head>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1" >
<title>Customer Maintenance</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"> </script>
</head>
<body>
Test 1 page
<p>Home Page</p><hr>
<footer>Created by: attentionjay</footer>
</body>
</html>
<a href="test2.php" >Test Inventory</a>
Page 2:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1" >
<title>Customer Maintenance</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<script>
$(function () {
$('#custalert').bind('submit', function (e) {
if($("input:first").val() == "") {
alert("You must enter a Customer Alert");
return false;
}
});
});
$(function () {
$('#queryinv').bind('submit', function (e) {
if($('#sku_checkbox').is(':checked') == true) {
alert("You must enter a SKU");
return false;
}
});
});
</script>
</head>
<body>
<div data-theme='a' >
<div style="padding:10px 20px;">
<form action="inventory_inquiry.php" method="get" id="queryinv" >
<h3>Enter SKU</h3>
<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
<legend>Choose Input Type:</legend>
<input type="radio" data-theme="a" name="input" id="sku_checkbox" />
<label for="sku_checkbox">SKU</label>
<input type="radio" data-theme="a" name="input" id="entire_checkbox" />
<label for="entire_checkbox">Entire Inventory</label>
</fieldset>
<label for="sku" class="ui-hidden-accessible">SKU:</label>
<input type="text" name="sku" id="sku" value="" placeholder="Item SKU" data-theme="a">
<input name="customer_id" type="hidden" value='<?php echo $customer_id; ?>'/>
<button type="submit" data-theme="b">Submit</button>
</form>
</div>
</div>
<br>
<p>Home Page</p><hr>
<footer>Created by: attentionjay</footer>
</body>
</html>
Any help I could get would be great. This is a mystery to me.
EDIT: 7-1-2013
I thought that it would be worth updating what I found while solving this problem. Disabling the AJAX data works, but only for links. I had difficulty getting it to work on a form submission. I ended up disabling AJAX globally with the following script:
<script>$(document).bind("mobileinit", function(){
$.mobile.ajaxEnabled = false;
});</script>
This script must be placed before the Jquery Mobile script on the page. This will disable the AJAX functionality for the entire page. AJAX is great and it should be used when possible. I had already set up the layout of my site before I discovered my problem. A site could more easily be retrofitted to make use of the Jquery Mobile functionality.
Try adding data-ajax="false" to your <a> tag whenever you are linking to a seperate php or html page.
jQuery mobile is designed for developers to put multiple pages int he same html or php file. So it uses ajax to link between those 'pages' which are really just divs. The issue with this is that, by default, jQuery mobile uses ajax for every link unless you state otherwise. This can create some cooky problems and it took me a while to understand when I first started with jQuery mobile. I think there's a pretty good doc about this topic in the JQM documentation.
adding
rel = "external"
works for me
Related
I have a simple form with a text input and a file input.
I want to do some processing with javascript (to show file upload percentage ) before submitting. But when i add .ajaxForm form action stops working (page doesn't redirect to the php file specified in action of the form.
index.php
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.3.0/jquery.form.min.js" integrity="sha384-qlmct0AOBiA2VPZkMY3+2WqkHtIQ9lSdAsAn5RUJD/3vA5MKDgSGcdmIv4ycVxyn" crossorigin="anonymous"></script>
<title>Document</title>
</head>
<body>
<form method="POST" id="myForm" action="some.php">
Name:<input type="text">
<input type="file">
<input type="submit" value="submit">
</form>
<script>
$("#myForm").ajaxForm({
beforeSubmit:function(){
console.log("Noo")
}
})
</script>
</body>
</html>
some.php is just an empty file
<?php
?>
I would like to know why the action stops working as soon as I add .ajaxForm
I have made the following attempts to fix my issue
add url,type to the object passed in .ajaxForm
$.post('some.php', $('#myForm').serialize())
This question already has answers here:
jQuery autocomplete with callback ajax json
(6 answers)
Closed 1 year ago.
I'm new to PHP and trying to implement an autocomplete as a proof of concept for a project for work.
The following is the code for the web page.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test</title>
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- jQuery UI library -->
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<!-- Initialize autocomplete -->
<script>
$(function() {
$("#skill_input").autocomplete({source: "search.php",});
});
</script>
</head>
<body>
<div class="container">
<h4>Auto complete Input for countries</h4>
<form method="post" action="submit.php">
<label > Your Skills:</label>
<input type="text" id = "skill_input" name="skill_input" placeholder="Start typing..."/>
<input type="submit" name="submit" value="SUBMIT">
</form>
</div>
</body>
</html>
The page displays as it should. As I type a valid search term for what is in the DB nothing happens. e.g. "Ger"
I'm running the site on xampp.
My DB is loaded with countries.
I put an echo in my DB module to see if it is reached. It is not displaying unless I use the URL of the DB module directly. When I go to the DB module directly using the URL http://localhost:8012/Managers/search.php?term=Ger
I receive the following
we are in the search php file
[“Algeria”,”Germany”,”Niger”,”Nigeria”]
This seems to indicate that the DB module is working e.g. accepting a search value, accessing the DB and returning data as expected.
So it appears to me that the script
$(function() {
$("#skill_input").autocomplete({
source: "search.php",
});enter code here
});
</script>
is not sending any data to the "search.php" page.
My question is why? Can anyone help me understand why the page is not sending any data to search.php? I would assume that it is not even calling search.php as I'm not seeing the echo message unless I use the URL directly.
The return of data is resolved.
/* Toss back results as json encoded array. */
$json_array = array();
$json_array = json_encode($return_arr);
echo json_encode($return_arr);
The above code coverts the response from the DB to json and then returns the data.
Here is what I am trying to do
1) Click on download pdf link.(There are list of pdfs)
2) On click Popup will open. Contact form is in the popup.
3) On submit button send mail and auto start download of PDF file.
4) At the same time of starting of download close the popup without redirecting to any page.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Download</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
Download
<!-- modal for download and contact -->
<div class="modal fade" id="download" role="dialog" >
<div class="modal-dialog" >
<div class="modal-content">
<!-- Your contact form goes here -->
<form method="post">
<input type="text" id="name" placeholder="name">
<input type="text" id="email" placeholder="email">
<button onclick="send();">send</button>
</form>
</div></div></div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script>
function send(){
var name = $("input#name").val();
var email = $("input#email").val();
$.ajax({
type: "POST",
url: "send.php", //your mailing code is place on send.php
data:'name='+ name'&email='+email,
success: function(data){
$('#download').modal('hide');
//window.open('pdf/fabrilinx-Sodium-Hydrosulphite.pdf');
window.location.href='pdf/fabrilinx-Sodium-Hydrosulphite.pdf'; //your file location
}
});
}
</script>
</body>
</html>
Problem occurs with this code
1) onclick download button, after entering detail pdf wont open in new window
2) How to download same pdf on witch user click, if there are multiple pdf download buttons are there
i have taken this code reference from another post but neither it works nor i have enough points to comments there.
On click open popup with form and then on submit download and close it! How?
Please anyone can help me to get the solution??
I've been trying to build a fairly simple phone-friendly web page that uses Paypal to complete payments. I got the solution running with a basic HTML form and a sample PHP Express Checkout, which was working fine until I started trying to use jquery mobile to make the page phone-friendly. I since tried another PHP library with the same result. The library I'm now using is from Angell EYE and I've created the following basic page:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dummy App</title>
</head>
<body>
<form method="get" action="paypal/SetExpressCheckout.php">
<label for="name">Name</label><input type="text" name="name" /><br />
<label for="qty">Quantity</label><input type="text" name="qty" /><br />
<input type="hidden" name="price" value="4.00" />
<input type="hidden" name="tax" value="1.40" />
<input type="submit" name="submit" value="submit" />
</form>
</body>
</html>
The Angell EYE library is located in a subdirectory called 'paypal' and after putting some dummy data into the form and clicking submit, I'm eventually directed to Paypal's Sandbox checkout and after completing the purchase I get back to the dummy site.
I then add in jquery as follows:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dummy App</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile- 1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.js"></script>
</head>
<body>
<form method="get" action="paypal/SetExpressCheckout.php">
<label for="name">Name</label><input type="text" name="name" /><br />
<label for="qty">Quantity</label><input type="text" name="qty" /><br />
<input type="hidden" name="price" value="4.00" />
<input type="hidden" name="tax" value="1.40" />
<input type="submit" name="submit" value="submit" />
</form>
</body>
</html>
At this point if I load the page and submit in Chrome, there's a wait of approx 6 seconds until the browser reports "Error Loading Page" and if I look in the Chrome console I see the following error:
XMLHttpRequest cannot load https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=commit&token=EC-81C31424M3017780Y. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://dummy.company.com' is therefore not allowed access.
If I remove the "" line from the page I no longer get the error, but I also (obviously) lose the phone optimisation...
There are lots of articles here explaining how to set HTTP headers on your server to avoid the problem; however in this case the resource is Paypal and I've found no mentioned of how/whether Paypal supports it...
Ultimately I want to build a PHP layer on my site that does some stuff and then submits initates the checkout process and I want to format the front page and had hoped to do it more easily with jqm.
I may be missing something really obvious.
Cheers,
Chris
Can anyone explain why it comes? it makes source code lengthy and it will affect to site SEO also. Site is using Sitecore CMS
Is this fault of .NET framework or Sitecore CMS?
Is PHP and other technology better to produce clean, semantic and W3C valid code?
These extra info in header (what is the use of these)
<head>
<meta name="CODE_LANGUAGE" content="C#" />
<meta name="vs_defaultClientScript" content="JavaScript" />
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
</head>
So much unneeded xhtml, JavaScript code just after body, why such a long code just after body?
<body>
<form name="MainForm" method="post" action="/en/site-services/alert.aspx" id="MainForm">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwMTk1MTQ1MDUPZBYGZg8VARdBbGVydCAgQm9va2VyIEdyb3VwIFBMQ2QCBg8VAQVhbGVydGQCBxBkZBYCAgEPZBYCAgEPZBYCZg9kFgJmDw8WAh4FQ2xhc3MFDWdsb2JhbFdyYXBwZXIWAh4FY2xhc3MFDWdsb2JhbFdyYXBwZXIWAmYPZBYGZg9kFgJmD2QWAmYPDxYCHwAFD0hlYWRlckNvbnRhaW5lchYCHwEFD0hlYWRlckNvbnRhaW5lchYCZg9kFgICAg8PFgQeCENzc0NsYXNzBQZTZWFyY2geBF8hU0ICAmQWAmYPDxYCHwAFG1NlYXJjaEdlbmVyYWxFcnJvckNvbnRhaW5lchYCHwEFG1NlYXJjaEdlbmVyYWxFcnJvckNvbnR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dHdvY29sdW1uc3JpZ2h0XzMkYWxlcnRzUk5TQ2F0ZWdvcnlDaGtfMwU4Ym9keV8xJGdsb2JhbF8xJHR3b2NvbHVtbnNyaWdodF8zJGFsZXJ0c1JOU0NhdGVnb3J5Q2hrXzQFOGJvZHlfMSRnbG9iYWxfMSR0d29jb2x1bW5zcmlnaHRfMyRhbGVydHNSTlNDYXRlZ29yeUNoa181BThib2R5XzEkZ2xvYmFsXzEkdHdvY29sdW1uc3JpZ2h0XzMkYWxlcnRzUk5TQ2F0ZWdvcnlDaGtfNgU4Ym9keV8xJGdsb2JhbF8xJHR3b2NvbHVtbnNyaWdodF8zJGFsZXJ0c0xhbmd1YWdlc0xpc3RCb3gFP2JvZHlfMSRnbG9iYWxfMSR0d29jb2x1bW5zcmlnaHRfMyRhbGVydHNUZXJtc0NvbmRpdGlvbnNZZXNSYWRpbwU+Ym9keV8xJGdsb2JhbF8xJHR3b2NvbHVtbnNyaWdodF8zJGFsZXJ0c1Rlcm1zQ29uZGl0aW9uc05vUmFkaW8FPmJvZHlfMSRnbG9iYWxfMSR0d29jb2x1bW5zcmlnaHRfMyRhbGVydHNUZXJtc0NvbmRpdGlvbnNOb1JhZGlvulpIpatDBOMCMBv4U0RYSLazybs=" />
</div>
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWFALT6IybBwK12ZCYCgL2hrCVDQKx6Oq/BQKvrM3CAgLk78yLBgLl78yLBgKN4Yb+AQL27ZH1DQL27dXjAwL27em+DAL27a2tAgL27cGICwL27YV3AszllaIKArua5/UCAo3Dqa0OAsr3g8gDAuW5heMGApqBqc4CprBsaYlxC8dTfOwmP1U0NzwPiic=" />
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['MainForm'];
if (!theForm) {
theForm = document.MainForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
My code starts from here:
<div id="globalWrapper">
<p>my all coded html comes here</p>
--
---
---
---
---
</div>
This is end of body with extra WebResource.axd file
<script src="/WebResource.axd?d=4AEhmjo4PfjXcTYk5tSDFQ2&t=633912595699095000" type="text/javascript"></script>
</form>
</body>
</html>
I invest so much time to make my XHTML clean but I can't control this unwanted code. Is there a way to get clean code?
use ASP.NET MVC if you don't want to deal with ViewState, theForm and other WebForms related issues.
The hidden fields that are visible from the markup you pasted form the core of ASP.NET WebFormns. It is quite long to describe here what is it all about, the topic is kinda big. The short answer is that you need all this if you want to properly use ASP.NET WebForms. You can take a look at this article you really want to understand what is the ViewState and what purposes it serves.
As for the axd link that you see, this is specially designated ASP.NET handler that servers for shipping javascript files to your page. It is automatically added to your rendered markup if there is ScriptManager in your aspx page.