Skip to content

Commit 563bd3e

Browse files
committed
Made the style for the error popup configurable in the Form class
1 parent d099d3b commit 563bd3e

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/form/Form.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ javaxt.dhtml.Form = function (parent, config) {
140140
backgroundColor: "white",
141141
padding: "0 5px 0 5px",
142142
color: "rgb(0, 70, 138)"
143+
},
144+
145+
146+
//Style for the error popup
147+
error: {
148+
input: "form-input-error",
149+
callout: {
150+
panel: "error-callout-panel",
151+
arrow: "error-callout-arrow"
152+
}
143153
}
144154
}
145155
};
@@ -563,6 +573,7 @@ javaxt.dhtml.Form = function (parent, config) {
563573
var formInput = addInput(name, label, input, getValue, setValue, icon);
564574

565575
input.oninput = function(){
576+
me.hideError(formInput);
566577
me.onChange(formInput, input.value);
567578
};
568579
input.onpaste = input.oninput;
@@ -1324,7 +1335,7 @@ javaxt.dhtml.Form = function (parent, config) {
13241335
if (inputs.length==0) inputs = td.getElementsByTagName("textarea");
13251336
if (inputs.length>0){
13261337
inputs[0].blur();
1327-
var cls = "form-input-error";
1338+
var cls = config.style.error.input;
13281339
if (inputs[0].className){
13291340
if (inputs[0].className.indexOf(cls)==-1) inputs[0].className += " " + cls;
13301341
}
@@ -1342,10 +1353,7 @@ javaxt.dhtml.Form = function (parent, config) {
13421353
var callout = javaxt.dhtml.Form.Error;
13431354
if (!callout){
13441355
callout = new javaxt.dhtml.Callout(document.body,{
1345-
style:{
1346-
panel: "error-callout-panel",
1347-
arrow: "error-callout-arrow"
1348-
}
1356+
style: config.style.error.callout
13491357
});
13501358
javaxt.dhtml.Form.Error = callout;
13511359
}

0 commit comments

Comments
 (0)