Hi,
there is no such build in functionallity in Visforms.
Here are some options what you could do.
1) basically Visforms already has a unique values only validation for almost every field type. You can find it in the field configuration tab advanced. But the unique values validation is performed after the form was submitted and if it fails the form is re-displayed. The custom error message which you can store with the field is then not be used and if you want to override the php error message for unique value validation you have to use the Joomla! language manager. The langague tag is "COM_VISFORMS_UNIQUE_VALUE_REQUIRED"
2) The jQuery validator, which already validates all user inputs in the browser has a strong grasp on the submit event. Therefore the only way to add your own javascript to the submit event is, to make an override of the file, that includes the javascirpt which instanciates the validator Basically that is possible because I always kept the javascirpt code, that instanciates the validator in the views/layouts files of Visforms which can be overriden in your template. But I must warn you, in order to improve Visforms I (sadly) have to make changes to the view/layout files quite often and the changes sometimes are severe. So although you overrides are not touched be a Visforms update, you most probably will have to adapt them after a Visforms update or Visforms will be broken.
If you are on Visforms 3.7. you would have to add your javascript in the default.php file of the component or module (depending on which on you use to display the form).
components/com_visforms/views/visforms/tmpl or modules/mod_visforms/tmpl
There is something like
Code:
jQuery('#visform<?php echo $this->visforms->id; ?>').validate({
....
)};
You have to add a
Code:
submitHandler: function(form)
{
//your code in here
form.submit();
},
object to this function.
On Visform 3.8 the code has moved to the components/com_visforms/layouts/visforms/scripts/validator.php file which is used be both, the component views and the module and can be overriden in the template, too.
Regards,
Aicha