Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript function onsubmit not working
    primarykey
    data
    text
    <p>I am trying out <a href="http://ahmeddirie.com/technology/web-development/salesforce-soap-api-and-php/comment-page-1/#comment-1338" rel="nofollow">this tutorial</a>. I have created an index.php that contains a form with the following code. The problem is that the form doesnt get submitted at all. The alerts arent called. Nothing happening.</p> <pre><code>&lt;?php require_once ('/soapclient/inc_connection.php'); function insert() // if(isset($_POST['submit'])) { //Describing the Leads object and printing the array $describe = $connection-&gt;describeSObjects(array('Lead')); print_r($describe); //Create New Lead $leadFirstName = "Ahmed"; $leadLastName = "Dirie"; $leadCompany = "Pick Yours Up"; $leadEmail = "adirie@pickyoursup.com"; //Creating the Lead Object $lead = new stdClass; $lead-&gt;type = 'Lead'; $lead-&gt;fields = array( 'FirstName' =&gt; $leadFirstName, 'LastName' =&gt; $leadLastName, 'Company' =&gt; $leadCompany, 'Email' =&gt; $leadEmail ); //Submitting the Lead to Salesforce $result = $connection-&gt;create(array($lead), 'Lead'); } ?&gt; </code></pre> <p>HTML:</p> <pre><code> &lt;h3&gt;Sign up for an evaluation:&lt;/h3&gt; &lt;span id="php_code"&gt; &lt;/span&gt; &lt;form action="https://docs.google.com/..../formResponse" method="POST" id="" target="_self" &gt;&lt;ol style="padding-left: 0"&gt; &lt;div class="ss-form-question errorbox-good"&gt; &lt;input type="button" name="submit" value="Contact Us" id="ss" onclick="return postToSql();"/&gt; .... </code></pre> <p>JS:</p> <pre><code>&lt;script type="text/javascript" src="libs/jquery-1.7.1.js" &gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function postToSql() { alert('1'); alert("&lt;?php insert(); ?&gt;"); //return false; } &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload