Jump to content

kamal213

Members
  • Posts

    198
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

kamal213's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hi there Ok tried to uploads the file but that doesn't work either so I'll start typing the code in full again. Below is the full jquery script responsible for parsing variable between file. it work fine in Internet explorer but not on Chrome or firefox. <script language = "JavaScript" type = "text/javascript"> function ajax_post(){ // Create our XMLHttpRequest object var hr = new XMLHttpRequest(); // Create some variables needed to send to our PHP file var url = "orderfilefunc.php"; var sd = document.getElementById("startdate").value; var ed = document.getElementById("enddate"). value; var ot = document.getElementById("ordertype").value; var vars = "startdate="+sd+"&enddate="+ed+"&ordertype="+ot; hr.open("POST", url, true); // SET content type header information for sending url encoded variables in the request hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // Access the onreadystatechange event for the XMLHttpRequest object hr.onreadystatechange = function() { if(hr.readyState == 4 && hr.status == 200) { //alert("form was submitted"); var return_data = hr.responseText; document.getElementById("status").innerHTML = return_data; } } // Send the data to PHP now... and wait for response to update the status div hr.send(vars); //Actually execute the request document.getElementById("status").innerHTML = "processing..."; } <script>
  2. Hi there Ok tried to uploads the file but that doesn't work either so I'll start typing the code in full again. Below is the full jquery script responsible for parsing variable between file. it work fine in Internet explorer but not on Chrome or firefox. <script language = "JavaScript" type = "text/javascript"> function ajax_post(){ // Create our XMLHttpRequest object var hr = new XMLHttpRequest(); // Create some variables needed to send to our PHP file var url = "orderfilefunc.php"; var sd = document.getElementById("startdate").value; var ed = document.getElementById("enddate"). value; var ot = document.getElementById("ordertype").value; var vars = "startdate="+sd+"&enddate="+ed+"&ordertype="+ot; hr.open("POST", url, true); // SET content type header information for sending url encoded variables in the request hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // Access the onreadystatechange event for the XMLHttpRequest object hr.onreadystatechange = function() { if(hr.readyState == 4 && hr.status == 200) { //alert("form was submitted"); var return_data = hr.responseText; document.getElementById("status").innerHTML = return_data; } } // Send the data to PHP now... and wait for response to update the status div hr.send(vars); //Actually execute the request document.getElementById("status").innerHTML = "processing..."; } <script>
  3. Hi there Ok tried to uploads the file but that doesn't work either so I'll start typing the code in full again. Below is the full jquery script responsible for parsing variable between file. it work fine in Internet explorer but not on Chrome or firefox. <script language = "JavaScript" type = "text/javascript"> function ajax_post(){ // Create our XMLHttpRequest object var hr = new XMLHttpRequest(); // Create some variables needed to send to our PHP file var url = "orderfilefunc.php"; var sd = document.getElementById("startdate").value; var ed = document.getElementById("enddate"). value; var ot = document.getElementById("ordertype").value; var vars = "startdate="+sd+"&enddate="+ed+"&ordertype="+ot; hr.open("POST", url, true); // SET content type header information for sending url encoded variables in the request hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // Access the onreadystatechange event for the XMLHttpRequest object hr.onreadystatechange = function() { if(hr.readyState == 4 && hr.status == 200) { //alert("form was submitted"); var return_data = hr.responseText; document.getElementById("status").innerHTML = return_data; } } // Send the data to PHP now... and wait for response to update the status div hr.send(vars); //Actually execute the request document.getElementById("status").innerHTML = "processing..."; } <script>
  4. Please find attached the full jquery code, please open with notepad, tried to type the code again but its been an absolute nightmare. Thanks
  5. Sorry guys please ignore the above I submitted the topic half way through typing by accident. this system is has been a nightmare to use. Tried to see if I could edit it but you cant copy and paste or upload so had to type the code again only to press submit and discover I cant save changes cause I don't have permission so I bit upset. Will try and type this again so please bear with me
  6. Hi guys The code below is meant to parse variables from one page/file to the next. It works perfectly on all IE's but not on Firefox or Chrome for some reason. Could you have a look please for the reason why it doesn't work on Firefox and Chrome and how this could be solved. Thanks a lot. <script language="JavaScript" type="text/javascript"> function ajax_post(){ //Create XMLHttpRequest object
  7. Wow! Barand you are a PHP god in human form! Thanks a lot that's exactly what I was looking for and more. Love the fact I can even update the previous records into a new column with the correct format. Thanks a bunch men, Amazing! Have a nice day!
  8. Hi there, I'm basically trying to do the following in mysql: SELECT sale_date FROM customer-sale WHERE sale_date BETWEEN '05/02/2015' AND '10/02/2015' However I keep getting 0 results, I found out that the issue is with my date format as it should be in (YYYY-mm-dd) format. Now I know, wish I know so about a year ago as I already have over 1500 records on my customer table so to late to change. So I need help with the following: 1.) Is there a search query that can convert dd/mm/yyyy into YYYY-mm-dd so I can run the above query 2.) Is there a way to convert the dates using PHP Need help Thanks a alot
  9. Hi all, I have an issue on my javascript code which I'd like you help with. I have a form validator functionality which check if a value is filled onsubmit and alerts then if its not. it looks like so: <script type="text/javascript"> function validate_form ( ) { valid = true; if (document.acform.c_city1.value == "") { alert ( "Please note the first box must be filled to create a result" ); valid = false; } return valid; } </script> Now this works perfectly fine no issues at all. The problem comes when I tell the above function to do something else. Which looks like so: <script type="text/javascript"> function validate_form ( ) { valid = true; if (document.acform.c_city1.value == "") { alert ( "Please note the first box must be filled to create a result" ); valid = false; } if ( (document.acform.c_city1.value != "") && (document.acform.c_city2.value != "") ) { window.open("<?php echo 'town1.php?c_city1=' . $c_city1 . '' ?>"); window.open("<?php echo 'town2.php?c_city2=' . $c_city2 . '' ?>"); } return valid; } </script> From the above, the second if statement, am asking it to open two windows, but then none of the statements work and I then get the following error: Message: Unterminated string constant Line: 20 Char: 20 Code: 0 Message: Object expected Line: 2 Char: 1 Code: 0 Please I need you help as I can see any obvious errors and don't know why it doesn't work at all. Many thanks
  10. Hi guys, The javascript code below is meant to open two new windows on submit. Its does so no problems on all browser apart from internet explore 9 for so reason. I'm I using a deprecated function? please help. Thanks <script> function popup(popupType) { window.open("<?php echo 'doc_print.php' ?>"); window.open("<?php echo 'doc_installation.php' ?>"); } </script> <form enctype="multipart/form-data" name="form1" method="POST" action="<?php echo 'gps_datahold.php' ?>" onsubmit="popup()"> Comment:<textarea name="g_comment" rows="3" cols="20"></textarea> </form>
  11. Hi guys, I was wondering is it possible to post to the database with javascript if a button on the page is clicked without reloading the page? I can't seem to find any example online. many thanks in advance
  12. Thanks very much it worked, problem solved
  13. Hi guys, how can you get sql to select all cities in your database beginning with the letter C for example? Thanks alot
  14. Just found the onClick function is also compatible with the <a> tag which is what I was looking for.. sorry I ask lol!
  15. Hi guys I was wondering how would I how would I do onClick so it works for links just like it does for buttons Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.