Skip to content

Instantly share code, notes, and snippets.

@patrickhaley
Last active September 5, 2017 18:59
Show Gist options
  • Save patrickhaley/3e93df70831169c34e14227645c1d9b7 to your computer and use it in GitHub Desktop.
Save patrickhaley/3e93df70831169c34e14227645c1d9b7 to your computer and use it in GitHub Desktop.
/* MIT License (MIT)
*
* Copyright (c) 2017 - Patrick Haley
* https://github.com/pshaley/netsuite-recaptcha/blob/master/netsuite_recaptcha_cs.js
*
* Original Author - Emil Olaguir, Jr.
* https://pulse.tips/google-recaptcha-for-netsuite-online-forms_58df6fb61723dda223accbef.html
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
function onSubmit() {
var captchaSuccess = false;
var captchaResponse = $('#g-recaptcha-response').val();
if (captchaResponse != "") {
captchaSuccess = true;
} else {
alert("Please prove you're not a robot.")
}
return captchaSuccess;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment