Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<link rel="stylesheet" type="text/css" href="" />
<script type="text/javascript">
$(document).ready(function() {
var bypassValidationAndTlBinding = false;
$("#MyForm").submit(function( e) {
if (!bypassValidationAndTlBinding) {
if( $("#firstname").val() != "dan" ) {
alert("the name is not dan");
} else {
alert("form is valid... now how come there is no progress bar after you hit ok? it still seems to upload to S3 though...");
wait: true,
bypassValidationAndTlBinding = true;
<h2>This should only submit if you enter dan in the FirstName textbox.</h2>
$params = array(
'auth' => array('key' => 'YOUR KEY'),
'template_id' => 'TEMPLATE_ID'
<form id="MyForm" action="" enctype="multipart/form-data" method="POST">
<input type='hidden' name='params' value="<?php echo htmlentities(json_encode($params)) ?>" /><br />
FirstName: <input type="text" name="firstname" id="firstname" ><br /><br /><br />
<input type="file" name="my_file" /><br /><br />
<input type="submit" value="Submit" id="submitform">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment