php - Wordpress Form + vTiger CRM Ajax -


i'm trying create form in wordpress send information vtiger crm , go custom registration page.

i have account-form.php loaded in own plugin -

 <form id="quickreg" name="quick registration" action="<?php bloginfo('url'); ?>/registration/" method="post" accept-charset="utf-8" onsubmit="return submitform();">     <p>         <input type="hidden" name="publicid" value="86705670b55224a08b5ec544c86f5e93">         </input>         <input id="name" type="hidden" name="qname" value="quick registration">         </input>     </p>     <p>         <input id="firstname" type="text" value="" name="qfirstname"  required="true" placeholder="first name">         </input>     </p>     <p>         <input type="text" value="" name="lastname"  required="true" placeholder="last name">         </input>     </p>     <p>         <input type="text" value="" name="email"  required="true" placeholder="email">         </input>     </p>     <p>         <input type="text" value="" name="phone"  placeholder="phone number">         </input>     </p>     <p>         <input type="text" value="" name="label:birthdate"  required="true" placeholder="birthdate">         </input>     </p>     <p>         <label>astro sign</label>         <select name="label:astro_sign" required="true">             <option value="aries">aries</option>             <option value="taurus">taurus</option>             <option value="gemini">gemini</option>             <option value="cancer">cancer</option>             <option value="leo">leo</option>             <option value="virgo">virgo</option>             <option value="libra">libra</option>             <option value="scorpio">scorpio</option>             <option value="sagittarius">sagittarius</option>             <option value="capricorn">capricorn</option>             <option value="aquarius">aquarius</option>             <option value="pisces">pisces</option>         </select>     </p>     <p>         <input id="btn-qreg" type="submit" value="submit" >         </input>     </p> </form> <br /> 

and have quickform.js:

$(document).ready(function() {  $("#btn-qreg").click(function() {      var url = "http://localhost/mycrm/modules/webforms/capture.php";     var sdata =  $("#quickreg").serialize() + "&name=" + $('#name').val() + "&firstname=" + $('#firstname').val();       alert('1');     $.ajax({         type : "post",         url : url,         data : sdata,         success : function(data) {         alert('2');         }     });      return false; }); });  

the problem when send form "return false;" don't normal form behavior, when remove "return false;" have normal behavior don't have ajax working @ all. need both of them working.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -