In “Account” module. I am using “Tab” Layout in Editview . In 2nd Tab “Industry” field is required.
If I am trying to save but “Industry” value is blank so I want to highlighted colour with “Tab Name” or any alert like “Please Submit Required field in Next Tab”…
So I am checking " validate_form" function at file /include/javascript/sugar_3.js
Here one function “add_error_style”
inside this function get “tabView” params .
but following lines are not working:
if (tabView.get) {
var tabs = tabView.get("tabs");
for (var i in tabs) {
if (tabs[i].get("contentEl") == parentDiv || YAHOO.util.Dom.isAncestor(tabs[i].get("contentEl"), inputHandle)) {
tabs[i].get("labelEl").style.color = "red";
if (inputsWithErrors.length == 1)
tabView.selectTab(i);
}
}
if (typeof selectTabOnErrorInputHandle == 'function') {
selectTabOnErrorInputHandle(inputHandle);
}
}
please check if it is possible from core file then this functionality work for all editview.
I know this is unupgrade-safe changes.I don’t want to do this.
I have done all the changes in custom folder but my new requirement is : "When field is required and click save button then Blank field “TAB Name” colour will be change.
So I want to field related tab name then I can add js in custom.
That’s why I have referred core file and found this code. but this code is not working so please suggest me good way…