• Resolved comfortking

    (@comfortking)


    It would be great if you could expand on how to use this with a custom form.

    $is_valid = apply_filters(‘google_invre_is_valid_request_filter’, true);
    if( ! $is_valid )
    {
    // handle error here
    }
    else
    {
    // continue with your logic
    }
    
    

    Not being a programmer it’s hard for me to sort this out. I know my way around WP – it would just be nice if it was a little more specific.

    Here’s an example of an actual form that I use:

    <form accept-charset="UTF-8" action="https://crm.zoho.com/crm/WebToLeadForm" method="POST" name="WebToLeads9999999999999999999"><input style="display: none;" name="xnQsjsdp" type="text" value="b02092ca101511f3e05f8a60a8f8cc6376f53e5ab0413a76d788866f59950bc9">
    <input id="zc_gad" name="zc_gad" type="hidden" value="">
    <input style="display: none;" name="xmIwtLD" type="text" value="4cfc026ab023470b084fcce2132fb50ffd47dbacfa2800ce8181f8070fc3cfbc">
    <input style="display: none;" name="actionType" type="text" value="TGVhZHM="><input style="display: none;" name="returnURL" type="text" value="https://OURWEBSITE/thank-you/">
    <input id="ldeskuid" style="display: none;" name="ldeskuid" type="text">
    <input id="LDTuvid" style="display: none;" name="LDTuvid" type="text">
    <select style="display: none;" name="Lead Source">
    <option selected="selected" value="Internet - Comfort King Website">Internet - Comfort King Website</option>
    </select>
    <input class="form-fields" name="First Name" type="text" placeholder="*First Name">
    <br>
    <br>
    <input class="form-fields" name="Last Name" type="text" placeholder="*Last Name">
    <br>
    <br>
    <input class="form-fields" name="Email" type="text" placeholder="*Email">
    <br>
    <br>
    <input class="form-fields" name="Mobile" type="text" placeholder="*Phone">
    <br>
    <br>
    <!-- Start Shortcoder content --><a style="text-align: center;"><textarea class="form-fields" name="Description" cols="30" rows="3" placeholder="*Project Details"></textarea></a><!-- End Shortcoder content -->
    <input class="submit-button-new" type="submit" value="Let's Get Started!"> 
    <script>
     	  var mndFileds=new Array('First Name','Last Name','Mobile','Email','Description');
     	  var fldLangVal=new Array('First Name','Last Name','Phone','Email','Description');
    		var name='';
    		var email='';
    
     	  function checkMandatory() {
    		for(i=0;i<mndFileds.length;i++) {
    		  var fieldObj=document.forms['WebToLeads2133762000000391018'][mndFileds[i]];
    		  if(fieldObj) {
    			if (((fieldObj.value).replace(/^\s+|\s+$/g, '')).length==0) {
    			 if(fieldObj.type =='file')
    				{ 
    				 alert('Please select a file to upload.'); 
    				 fieldObj.focus(); 
    				 return false;
    				} 
    			alert(fldLangVal[i] +' cannot be empty.'); 
       	   	  	  fieldObj.focus();
       	   	  	  return false;
    			}  else if(fieldObj.nodeName=='SELECT') {
      	   	   	 if(fieldObj.options[fieldObj.selectedIndex].value=='-None-') {
    				alert(fldLangVal[i] +' cannot be none.'); 
    				fieldObj.focus();
    				return false;
    			   }
    			} else if(fieldObj.type =='checkbox'){
     	 	 	 if(fieldObj.checked == false){
    				alert('Please accept  '+fldLangVal[i]);
    				fieldObj.focus();
    				return false;
    			   } 
    			 } 
    			 try {
    			     if(fieldObj.name == 'Last Name') {
    				name = fieldObj.value;
     	 	 	    }
    			} catch (e) {}
    		    }
    		}
    		trackVisitor();
    	}
    </script><script type="text/javascript" id="VisitorTracking">var $zoho= $zoho || {salesiq:{values:{},ready:function(){$zoho.salesiq.floatbutton.visible('hide');}}};var d=document;s=d.createElement('script');s.type='text/javascript';s.defer=true;s.src='https://salesiq.zoho.com/comfortking/float.ls?embedname=comfortking';t=d.getElementsByTagName('script')[0];t.parentNode.insertBefore(s,t);function trackVisitor(){try{if($zoho){var LDTuvidObj = document.forms['WebToLeads999999999999999']['LDTuvid'];if(LDTuvidObj){LDTuvidObj.value = $zoho.salesiq.visitor.uniqueid();}var firstnameObj = document.forms['WebToLeads999999999999999999']['First Name'];if(firstnameObj){name = firstnameObj.value +' '+name;}$zoho.salesiq.visitor.name(name);var emailObj = document.forms['WebToLeads9999999999999999999']['Email'];if(emailObj){email = emailObj.value;$zoho.salesiq.visitor.email(email);}}} catch(e){}}</script>
    </form>

    Any thoughts how I’d integrate it into this form?

    Thanks,

    Ron

    • This topic was modified 7 years, 11 months ago by comfortking.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom Form’ is closed to new replies.