Hi,
The simple solution is to edit the HikaShop view "checkout custom_fields"
www.hikashop.com/en/support/documentatio...ashop-view-form.html
Replace the portion of code:
$onWhat='onchange'; if($oneExtraField->field_type=='radio') $onWhat='onclick';
echo $this->fieldsClass->display($oneExtraField,$this->$type->$fieldName,'data['.$type.']['.$fieldName.']',false,' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type.'\',0);"');
By:
$onWhat='onchange="';
if($oneExtraField->field_type=='radio')
$onWhat='onclick="';
if($fieldName == 'tallyserial') { // Only on your specific custom field
$msg = 'Please enter a valid serial'; // Your warning message
$msg = str_replace("'", "\\'", str_replace("\\", "\\\\", $msg)); // Secure the warning message for javascript serialization
$onWhat = 'onchange="if(this.value.length > 0 && !(/^[0-9]{9}$/.test(this.value))){this.value=\'\';alert(\''.$msg.'\')};'; // Your javascript check (only 9 digits)
}
echo $this->fieldsClass->display($oneExtraField,$this->$type->$fieldName,'data['.$type.']['.$fieldName.']',false,' '.$onWhat.'hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type.'\',0);"');
Regards,