JSFiddle - React, Tailwind, and code Playground

by Ryan Perez

HTML

<form name="catwebformform58915" method="post" onsubmit="return checkWholeForm58915(this)" enctype="multipart/form-data" action="/FormProcessv2.aspx?WebFormID=117524&amp;OID=4983916&amp;OTYPE=35&amp;EID=0&amp;CID=0"> <span class="req">*</span> Required
<table class="table" cellspacing="0" cellpadding="2" border="0">
<input value="[email protected]" placeholder="Email Address" type="hidden" name="EmailAddress" id="EmailAddress" class="form-control" maxlength="255">
<tbody><tr>
<td>
<input placeholder="File Name" type="text" maxlength="4000" name="CAT_Custom_451128" id="CAT_Custom_451128" class="form-control">
</td>
</tr>
<tr>
<td>
<textarea placeholder="File Description" name="CAT_Custom_451129" id="CAT_Custom_451129" cols="10" rows="4" class="form-control" onkeydown="if(this.value.length>=4000)this.value=this.value.substring(0,3999);"></textarea><grammarly-btn><div style="z-index: 2; opacity: 1; transform: translate(727px, 188px);" class="_fc3-textarea_btn _fc3-not_focused" data-grammarly-reactid=".0"><div class="_fc3-transform_wrap" data-grammarly-reactid=".0.0"><div title="Protected by Grammarly" class="_fc3-status" data-grammarly-reactid=".0.0.0">&nbsp;</div></div></div></grammarly-btn>
</td>
</tr>
<tr>
<td><div style="display: none">
<input type="text" name="s_content" id="s_content" class="cat_textbox">
<input type="text" name="s_summary" id="s_summary" class="cat_textbox" value="ab19ce46ce2c40419a586579fa348752">
</div>
</td>
</tr>
<tr>
<td>
<label for="FileAttachment">Attach File (250Mb Limit <span class="req">*</span>)</label>
<br>
<input type="file" name="FileAttachment" id="FileAttachment" class="cat_textbox">
</td>
</tr>
<tr>
<td>
<input class="cat_button" type="submit" value="Submit" id="catwebformbutton">
</td>
</tr>
</tbody></table>

</form>

JavaScript

//<![CDATA[
        var submitcount58915 = 0;

        function checkWholeForm58915(theForm) {
                var why = "";
                if (theForm.EmailAddress) why += checkEmail(theForm.EmailAddress.value);
                if (theForm.FileAttachment) why += isEmpty(theForm.FileAttachment.value, "File Attachment");
                if (why != "") {
                    alert(why);
                    return false;
                }
                if (submitcount58915 == 0) {
                    submitcount58915++;
                    theForm.submit();
                    return false;
                } else {
                    alert("Form submission is in progress.");
                    return false;
                }
            }
            //]]>

  });