Note that there are some explanatory texts on larger screens.

plurals
  1. POBackbone.js with php interaction
    primarykey
    data
    text
    <p>I have tried to create the user interaction page with backbone.js &amp; php. But I can't able to call the function when i submit the html form. Anyone can assist me?</p> <p>Here are the code</p> <pre><code> &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://documentcloud.github.com/underscore/underscore.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://documentcloud.github.com/backbone/backbone.js"&gt;&lt;/script&gt; &lt;!--- Here are the backbone code ---&gt; &lt;script type="text/javascript"&gt; var FamilyModel = Backbone.Model.extend({   defaults: {     name: "Corleone"   },   url: "back.php" }); var FamilyList = Backbone.Collection.extend({   model: FamilyModel }); var FamilyListView = Backbone.View.extend({ el: $('#SampleForm'), model: FamilyModel, events: { 'click #Submit': 'createOne' }, createOne: function(e){ e.preventDefault(); alert('Yes'); } }); // Fire up the application: window.App = new FamilyListView; &lt;/script&gt; &lt;!-- //HTML --&gt; &lt;form name="SampleForm" id="SampleForm"&gt; &lt;table&gt; &lt;tr&gt;&lt;td&gt;Name:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="varName"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Age:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="intAge"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Mobile:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="intMobile"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td colspan="2" align="center"&gt;&lt;input type="submit" name="Submit" id="Submit" value="ADD"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>Expecting your valuable response ASAP. Thanks</p>
    singulars
    1. This table or related slice is empty.
    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.
    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