Thanks, Nicolas.
Yes, you are right. It does get executed. Apologies for the wild goose chase.
I have another question regarding the function (or rather the hikashopCheckField function).
Instead of a popup message appearing when a validation error is found, I like the error message to be displayed inline (for instance, have the label of the input box replaced). As an example, say the post code box does not have a value and the "OK" button is clicked, the label for the post code box will now say "Please enter a value for the field Postcode".
I have modified the following code in hikashopCheckField from
alert(hikashopFieldsJs['validFieldsComp'][type][i]);
to
var labelName = 'label_' + elementToCheck.id;
window.Oby.updateElem(labelName, hikashopFieldsJs['validFieldsComp'][type][i]);
Note that I have added the id for the label in the function getFieldName (in /administrator/components/com_hikashop/classes/field.php) as follows.
return '<label id="label_' .$field->field_namekey. '" for="'.$this->prefix.$field->field_namekey.$this->suffix.'">'.$this->trans($field->field_realname).$required.'</label>';
Unfortunately, the new label is not displayed. I think what I am missing is a call to the document.ready function.
Please could you direct me on how I can get the code to work to show the new label? Do I need to all the window.Oby.ready function? If so, what is the parameter to pass in?
Thanks.
Take care!