Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Adding an onSubmit="" to Sign-up form, any easy way?
mahodder
New
Is there any easy way to add something like:
onSubmit="return ValidateForm()"
inside the <form> tag for the sign up form? I want to be able to validate some custom fields with javascript before the form is submitted.
I'm crossing my fingers that this would be an easy hack, I have tried to figure it out myself but so far no luck.
0
This discussion has been closed.
Comments
people_apply_form_nopostback.php
into thethemes/Vanilla
folder, and make your edit.<?php // Note: This file is included from the library/People/People.Control.ApplyForm.php class. echo '<div class="About"> '.$this->Context->GetDefinition('AboutMembership').' <p><a href="'.GetUrl($this->Context->Configuration, $this->Context->SelfUrl).'">'.$this->Context->GetDefinition('BackToSignInForm').'</a></p> </div>
<div id="Form" class="ApplyForm" onsubmit="return ValidateForm()">
<fieldset> <legend>'.$this->Context->GetDefinition('MembershipApplicationForm').'</legend> <p>'.$this->Context->GetDefinition('AllFieldsRequired').'</p>';
edit: Oh shoot... that isn't a form element, its a div... checking...
put your javascript functions into [directory of vanilla install]/js/global.js
then, open up the file in the /theme folder, and add {onsubmit="function();"} right after the opening "<form" tag.