You need to sign in to do that
Don't have an account?
Pavani Akella 9
Web-to-case
Hi,
I have written a HTML code for web-to-case form with 'RECAPTCHA' code but it is working when I'm trying to deploy it in website. Below is the code:
<apex:page>
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">
<script src="https://www.google.com/recaptcha/api.js"></script>
<script>
function timestamp() { var response = document.getElementById("g-recaptcha-response"); if (response == null || response.value.trim() == "") {var elems = JSON.parse(document.getElementsByName("captcha_settings")[0].value);elems["ts"] = JSON.stringify(new Date().getTime());document.getElementsByName("captcha_settings")[0].value = JSON.stringify(elems); } } setInterval(timestamp, 500);
</script>
<script type="text/javascript">
function recaptcha_callback(){
$('.button').prop("disabled", false);
}
</script>
<form action="https://webto.salesforce.com/servlet/servlet.WebToCase?encoding=UTF-8" method="POST">
<input type="hidden" name='captcha_settings' value='{"keyname":"captchacode","fallback":"true","orgId":"00D80000000PSJg","ts":""}'>
<input type="hidden" name="orgid" value="00D80000000PSJg">
<input type=hidden name="recordType" id="recordType" value="01234000000URAx">
<input type="hidden" name="retURL" value="http://www.roushcleantech.com/training_request_form_landing_page/">
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: These fields are optional debugging elements. Please uncomment -->
<!-- these lines if you wish to test in debug mode. -->
<!-- <input type="hidden" name="debug" value=1> -->
<!-- <input type="hidden" name="debugEmail" -->
<!-- value="pavani.akella@roush.com"> -->
<!-- ---------------------------------------------------------------------- -->
Your Name:<input id="00N34000005gy3N" maxlength="30" name="00N34000005gy3N" size="20" type="text" required=true /><br>
Your Email:<input id="00N34000005gy3S" maxlength="80" name="00N34000005gy3S" size="20" type="text" required=true /><br>
Your Phone:<input id="00N34000005gy3X" maxlength="40" name="00N34000005gy3X" onkeydown="formatPhoneOnEnter(this, event);" size="20" type="text"required=true /><br>
Service Center Requesting Training:<textarea id="00N34000005gy3c" name="00N34000005gy3c" type="text" wrap="soft" required=true ></textarea><br>
Requested Training Location Address:<textarea id="00N34000005gy3h" name="00N34000005gy3h" type="text" wrap="soft" required=true ></textarea><br>
City:<input id="00N34000005gy3m" maxlength="20" name="00N34000005gy3m" size="20" type="text" required=true /><br>
State:<input id="00N34000005gy3r" maxlength="20" name="00N34000005gy3r" size="20" type="text" required=true /><br>
Location Contact(if different):<input id="00N34000005gy3w" maxlength="30" name="00N34000005gy3w" size="20" type="text" /><br>
Location Phone #:<input id="00N34000005gy41" maxlength="40" name="00N34000005gy41" onkeydown="formatPhoneOnEnter(this, event);" size="20" type="text" /><br>
Approx No. of attendees:<input id="00N34000005gy46" maxlength="20" name="00N34000005gy46" size="20" type="text" required=true /><br>
Product Focus for training:<select id="00N34000005gy4B" name="00N34000005gy4B" title="Product Focus for training"><option value="" required=true >--None--</option><option value="Blue Bird Propane">Blue Bird Propane</option>
<option value="Blue Bird CNG">Blue Bird CNG</option>
<option value="Ford E-450">Ford E-450</option>
<option value="Ford F450/F-550">Ford F450/F-550</option>
<option value="Ford F-650/F-750">Ford F-650/F-750</option>
<option value="Ford F-53/F-59">Ford F-53/F-59</option>
</select><br>
Time Frame:<input id="00N34000005gy4G" maxlength="30" name="00N34000005gy4G" size="20" type="text" required=true /><br>
Comments:<textarea id="00N34000005gy4L" name="00N34000005gy4L" type="text" wrap="soft"></textarea><br>
<input type="hidden" id="external" name="external" value="1"/><br>
<div class="g-recaptcha" data-sitekey="6LfLGjUUAAAAAAPyqw7rghuHXYD3DggnQ2Mwz7z_" data-callback="recaptcha_callback"></div>
<input type="submit" name="submit"id="submitBtn" disabled="true" class="button">
</form>
</apex:page>
Thanks in advance for the help
I have written a HTML code for web-to-case form with 'RECAPTCHA' code but it is working when I'm trying to deploy it in website. Below is the code:
<apex:page>
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">
<script src="https://www.google.com/recaptcha/api.js"></script>
<script>
function timestamp() { var response = document.getElementById("g-recaptcha-response"); if (response == null || response.value.trim() == "") {var elems = JSON.parse(document.getElementsByName("captcha_settings")[0].value);elems["ts"] = JSON.stringify(new Date().getTime());document.getElementsByName("captcha_settings")[0].value = JSON.stringify(elems); } } setInterval(timestamp, 500);
</script>
<script type="text/javascript">
function recaptcha_callback(){
$('.button').prop("disabled", false);
}
</script>
<form action="https://webto.salesforce.com/servlet/servlet.WebToCase?encoding=UTF-8" method="POST">
<input type="hidden" name='captcha_settings' value='{"keyname":"captchacode","fallback":"true","orgId":"00D80000000PSJg","ts":""}'>
<input type="hidden" name="orgid" value="00D80000000PSJg">
<input type=hidden name="recordType" id="recordType" value="01234000000URAx">
<input type="hidden" name="retURL" value="http://www.roushcleantech.com/training_request_form_landing_page/">
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: These fields are optional debugging elements. Please uncomment -->
<!-- these lines if you wish to test in debug mode. -->
<!-- <input type="hidden" name="debug" value=1> -->
<!-- <input type="hidden" name="debugEmail" -->
<!-- value="pavani.akella@roush.com"> -->
<!-- ---------------------------------------------------------------------- -->
Your Name:<input id="00N34000005gy3N" maxlength="30" name="00N34000005gy3N" size="20" type="text" required=true /><br>
Your Email:<input id="00N34000005gy3S" maxlength="80" name="00N34000005gy3S" size="20" type="text" required=true /><br>
Your Phone:<input id="00N34000005gy3X" maxlength="40" name="00N34000005gy3X" onkeydown="formatPhoneOnEnter(this, event);" size="20" type="text"required=true /><br>
Service Center Requesting Training:<textarea id="00N34000005gy3c" name="00N34000005gy3c" type="text" wrap="soft" required=true ></textarea><br>
Requested Training Location Address:<textarea id="00N34000005gy3h" name="00N34000005gy3h" type="text" wrap="soft" required=true ></textarea><br>
City:<input id="00N34000005gy3m" maxlength="20" name="00N34000005gy3m" size="20" type="text" required=true /><br>
State:<input id="00N34000005gy3r" maxlength="20" name="00N34000005gy3r" size="20" type="text" required=true /><br>
Location Contact(if different):<input id="00N34000005gy3w" maxlength="30" name="00N34000005gy3w" size="20" type="text" /><br>
Location Phone #:<input id="00N34000005gy41" maxlength="40" name="00N34000005gy41" onkeydown="formatPhoneOnEnter(this, event);" size="20" type="text" /><br>
Approx No. of attendees:<input id="00N34000005gy46" maxlength="20" name="00N34000005gy46" size="20" type="text" required=true /><br>
Product Focus for training:<select id="00N34000005gy4B" name="00N34000005gy4B" title="Product Focus for training"><option value="" required=true >--None--</option><option value="Blue Bird Propane">Blue Bird Propane</option>
<option value="Blue Bird CNG">Blue Bird CNG</option>
<option value="Ford E-450">Ford E-450</option>
<option value="Ford F450/F-550">Ford F450/F-550</option>
<option value="Ford F-650/F-750">Ford F-650/F-750</option>
<option value="Ford F-53/F-59">Ford F-53/F-59</option>
</select><br>
Time Frame:<input id="00N34000005gy4G" maxlength="30" name="00N34000005gy4G" size="20" type="text" required=true /><br>
Comments:<textarea id="00N34000005gy4L" name="00N34000005gy4L" type="text" wrap="soft"></textarea><br>
<input type="hidden" id="external" name="external" value="1"/><br>
<div class="g-recaptcha" data-sitekey="6LfLGjUUAAAAAAPyqw7rghuHXYD3DggnQ2Mwz7z_" data-callback="recaptcha_callback"></div>
<input type="submit" name="submit"id="submitBtn" disabled="true" class="button">
</form>
</apex:page>
Thanks in advance for the help
- Check the HTML code for any syntax errors or issues that may be causing the form to not work. You can use a tool like the W3C Markup Validation Service to check the HTML code for errors.
- Test the form on your website by filling out the fields and submitting the form. This can help you identify any issues with the form submission process.
- Check the Salesforce Web-to-Case settings to ensure that the form is configured correctly. You may need to verify that the record type and organization ID are correct, and that the form is enabled.
- Check the Salesforce security settings to ensure that the form submissions are being accepted. You may need to add the website domain to the Salesforce trusted domains list or adjust the security settings for the Web-to-Case feature.
For more information on Salesforce Web-to-Case and how to set up a web-to-case form, you can refer to the Salesforce documentation or this guide: "Everything about Salesforce Web Forms - From Leads to Cases and Custom Objects" https://arrify.com/salesforce-form-guide.