Expand my Community achievements bar.

function formats textfields

Avatar

Former Community Member
hi there,



MY IDEA:

every textfield in my form shall behave in the same way.

For example background color is changing if the field is entered.



I don' t want to script the whole batch of javascript-commands for every single textfield.

Instead I' d like to put one function in a script objekt called SO containing all necessary commands.

Then I' d like to start this function from each textfield.



MY PROBLEM:

I don`t manage to put the name of my textfields in a parameter of my function in a way javascript makes it run.



EXAMPLE:

/* this is a function in the script objekt called SO */



function fu_form_mark (P_TEXTFIELD){

xfa.form.myform1.P_TEXTFIELD.border.presence="visible";

xfa.form.myform1.P_TEXTFIELD.border.fill.color.value="100,50,100";

.....

}



/* this is a textfield in my form */

----- myform1.#subform[0].TXT_1::exit - (JavaScript, client) ----------



var V_MARK_FIELD = SO.fu_form_mark("TXT_1");



QUESTION:

How do I have to script this example to make it work ?
0 Replies