Clear input on failed data validation
Posted: 2016-12-14 13:48
Hello!
At this moment i use in common.js.php the following code to compare the ship and prod fileds:
This works Ok, but i would need, that when the focus is set on the "ship" field, the content should be deleted. Now the previously entered wrong content stays.
Any help would be greately appreciated.
At this moment i use in common.js.php the following code to compare the ship and prod fileds:
Code: Select all
if($j('#ship').val() != $j('#prod').val()){ modal_window({ message: '<div class="alert alert-danger"><?php echo addslashes($Translation['field not equal']); ?></div>', title: "<?php echo addslashes($Translation['error:']); ?> Szállítólevélről kód", close: function(){ $j('[name=ship]').focus(); $j('[name=ship]').parents('.form-group').addClass('has-error'); } }); return false; };
Any help would be greately appreciated.