JSFiddle - React, Tailwind, and code Playground

by ryleyb

HTML

<script src="http://dev.jquery.com/view/trunk/plugins/validate/lib/jquery.delegate.js"></script>
<script src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>
<form id="myform" action="upload" method="post" enctype="multipart/form-data">

Select file to upload: *    
<input type="file" name="file" id="file" title="Please select a file to upload"><br>

Name for file: *
<input type="text" name="name" value="{{ name }}" id="new_file_name" title="Please choose a filename"><br>

Select owner for file: *
<select name="owner" id="owner" title="Please select an owner">
<option value="">[ Choose an owner ]</option>
<option value="valid1">valid option</option>
</select><br>

File comments:
<textarea rows="5" cols="20" name="comments">{{ comments }}</textarea>

<input type=submit value=Upload>
</form>

CSS

.error { color: red; }

JavaScript

jQuery.validator.setDefaults({
    debug: false,
    success: "valid"
});

   $("#myform").validate({
  rules: {
    file: "required",
    name: "required",
    owner: "required"
  }
});