JSFiddle - React, Tailwind, and code Playground
by Chase Wilson
HTML
{% signup_form ref:"some_contest" %}
JavaScript
var some_contest = {
"rules" :{
'registration[name]': {required: true}
,'registration[email]': {required: true, email:true}
,'submission[mood]': {required: true}
,'submission[before_photo]': {required: true}
}
,"messages" : {
'registration[name]': 'You must enter your name'
,'registration[email]': 'You must enter your email'
,'submission[mood]': 'What mood does this photo represent?'
,'submission[before_photo]': 'You must enter a photo for the photo contest'
}
,"onsuccess":function(){
alert('Whoopie");
}
,"onerror":function(){
alert('Damnit');
}
};