Check Value Of 2 Fields

In my view I open a modal popup with 2 fields

					<label for="password">Inserire nuova password:</label>


        <input name="ag[password]" type="password" value="<?=$ag->password?>">				





					<label for="repassword">Reinserire nuova Password:</label>


        <input name="ag[repassword]" type="password">          

I’d like to insert a script in view, for check that “repassword” value is == first “password” value. Ho can I do this?

Another question, suppose that I’d like to use AngularJS for manage this, how could be right solution?

I’d like to know 2 solutions:

  1. Simple JS check

  2. AngularJS check

Thanks

  1. Add onsubmit handler that ensures that input values are equal and returns false otherwise.

  2. You should read AngularJS documentation. This is not Angular/Knockout/whatever forum.