Jump to content

Muiter

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Muiter

  1. The problem still exists when I remove the edit and delete forms.
  2. OK, I moved it to an place where you can test this yourself. See here for function without BootstrapToggele: https://torza.nl/toggle_no_issue.php See here for function with BootstrapToggele: https://torza.nl/toggle_issue.php Click on the mail icon to test. When te form is send I have used: print_r($_POST); exit; The form without BootstrapToggele has the correct value on the end of this ([mail_dossier_gereed] => ja), the form with BootstrapToggele does not have this value.
  3. OK, but all the normal form textfields in the same form are not losing there data, why should be that any different for the checkbox? (also this did not solve my problem)
  4. I don't understand what you mean? I have checked the form output there and it is not showing up when I use Bootstrap Toggle. It showing up when I use an standard checkbox.
  5. When I add an extra check like this: onclick="validate(this, '.$i.')" <script> function validate(selectVeld, nr) { window.alert("You clicked me"); } </script> When I have not used the Bootstrap Toggle I get the message "You clicked me", but when I add Bootstrap Toggle I am not getting the message.
  6. I have changed all URLs to absolute. Did not solve the problem. This is the JS I am using so send the form. $(document).ready(function () { $(".mail_table_4").on('click', function() { formid=($(this).attr("alt")); subform_mail_table_4(formid); }); }); function subform_mail_table_4(formid) { var postData = $("#mail_table_4"+formid).serializeArray(); var formURL='processing/factuur_mail.php'; $.ajax({ url: formURL, type: "POST", data: postData, success: function(data, textStatus, jqXHR) { $('#modal_mail_table_4'+formid+' .modal-body').html(data); $("#submit_mail_table_4"+formid).remove(); }, error: function(jqXHR, status, error) { console.log(status + ": " + error); } }); e.preventDefault(); }
  7. I am using Bootstrap Toggle in my script. I have it included like this: <!-- jQuery --> <script src="vendor/jquery/jquery.min.js"></script> <!-- Toggele http://www.bootstraptoggle.com --> <script src="vendor/bootstrap-toggle/bootstrap-toggle.min.js"></script> <!-- Toggele CSS --> <link href="vendor/bootstrap-toggle/bootstrap-toggle.min.css" rel="stylesheet"> So when I use a checkbox as a normal checkbox without the Bootstrap Toggle markup the value (when box is checked) it is send with the form. When I add the Bootstrap Toggle to this the value is not send (when checked) <div class="col-md-2 text-center" style="padding-top: 20px;"> <input type="checkbox" id="mail_dossier_gereed['.$i.']" name="mail_dossier_gereed" value="ja" data-width="200" data-toggle="toggle" data-toggle="toggle" data-size="large" data-onstyle="success" data-offstyle="info" data-on="Project is afgerond" data-off="Project niet afgerond" checked> </div> I have checked this with print_r($_POST). The form where this checkbox is located in a bootstrap modal, this modal is located in my subfolder modal. When I use this kind of checkbox in a file that is located in the root of my server, then Bootstrap Toggle is correctly sending the value (when checked). Any suggestions why this not might work when the file is located in a modal? The form of the modal is send thru JS, maybe that is also an issue, but I don't think so because an normal checkbox is send correctly (when checked)
  8. Ok I have sorted some things out and the basic script is working. But how do I implement this in my php files? It's AJAX script but I have an problem with php so I have posted it in this forum. The original script can be found here: http://www.weberdev.com/get_example-4389.html test.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Customer Account Information</title> <script type="text/javascript"> var url = "zoek_offerte_order.php?id="; // The server-side script function handleHttpResponse() { if (http.readyState == 4) { if(http.status==200) { var results=http.responseText; document.getElementById('divCustomerInfo').innerHTML = results; } } } function requestCustomerInfo() { var sId = document.getElementById("txtCustomerId").value; http.open("GET", url + escape(sId), true); http.onreadystatechange = handleHttpResponse; http.send(null); } function getHTTPObject() { var xmlhttp; if(window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); if (!xmlhttp){ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } } return xmlhttp; } var http = getHTTPObject(); // We create the HTTP Object </script> </head> <body> <select id="txtCustomerId" onchange="requestCustomerInfo()"> <option>Kies offertenummer</option> <?php mysql_connect(xxxxx,xxxx,xxxx); mysql_select_db(xxxxx); $query="select offerte from offertenummers order by offerte desc"; $result=mysql_query($query); while(list($CustomerId)=mysql_fetch_row($result)) { echo "<option value=\"".$CustomerId."\">".$CustomerId."</option>"; } ?> </select> <div id="divCustomerInfo"></div> </body> </html> zoek_offerte_order.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <?php //customer ID $sID = $_GET["id"]; //variable to hold customer info $sInfo = ""; //database information $sDBServer = "xxxxx"; $sDBName = "xxxx"; $sDBUsername = "xxxx"; $sDBPassword = "xxxx"; //create the SQL query string $sQuery = "Select o.offerte, o.klant_id, o.omschrijving, a.klantnaam FROM offertenummers AS o INNER JOIN adressen AS a ON a.id = o.klant_id where offerte=".$sID; //make the database connection $oLink = mysql_connect($sDBServer,$sDBUsername,$sDBPassword); @mysql_select_db($sDBName) or $sInfo = "Unable to open database"; if($sInfo == '') { if($oResult = mysql_query($sQuery) and mysql_num_rows($oResult) > 0) { $aValues = mysql_fetch_array($oResult,MYSQL_ASSOC); $sInfo = $aValues['klantnaam']."<br />".$aValues['omschrijving']."<br />". "<a href=\"mailto:".$aValues['E-mail']."\">".$aValues['E-mail']."</a>"; } else { $sInfo = "Offertenummer $sID bestaat niet."; } } mysql_close($oLink); ?> </head> <body> <div id="divInfoToReturn"> <?php echo $sInfo ?> </div> </body> </html> I habe 2 questions, 1st: why can't I remove the line "<a href=\"mailto:".$aValues['E-mail']."\">".$aValues['E-mail']."</a>"; if I do an error comes up. 2nd: how do I implement the code for the pulldown menu of test.php is this code: <td class="dr"><select name="offerte_id"> <?php $sql = "select `offerte`, `offerte` from `offertenummers` ORDER BY `offertenummers`.`offerte` DESC"; $res = mysql_query($sql, $conn) or die(mysql_error()); while ($lp_row = mysql_fetch_assoc($res)){ $val = $lp_row["offerte"]; $caption = $lp_row["offerte"]; if ($row["offerte_id"] == $val) {$selstr = " selected"; } else {$selstr = ""; } ?><option value="<?php echo $val ?>"<?php echo $selstr ?>><?php echo $caption ?></option> <?php } ?></select> </td> Please help me solve this.
×
×
  • 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.