Create and Attach Event to Button via JavaScript


hi guys,

 

is there way create event dynamically , attach button?

my idea basically:

-) create event (eg click)

-) add script node event

-) add button

-) force remerge of different models

 

what tried change type of existing event , using remerge() have in dom didn't work.

 

if possible change event type of existing event work me.

 

best regards,

john

i  have same requirement.

 

i requested make radio button work toggle. if click on selected value, clear selection.

 

i able using script trick. basically, had use global variable save selected value on mouseenter event each member of radio button selection, , onclick event of radio button selection group, if value selected same saved value, clear selection.

 

i using "savedvalue" document global variable.

 

following code:

 

 

//click event of radio button if (this.rawvalue == savedvalue.value) {   this.rawvalue = "";   savedvalue.value = ""; } else {   savedvalue.value = this.rawvalue; }  //mouseenter event each of selection of radio button if (savedvalue.value !== this.parent.rawvalue) {   savedvalue.value = this.parent.rawvalue } 

 

the above code works charm !!

 

now, trying do, use code loop assign above script "click" event , "mouseenter" event indicated above. save lots of time. can run code on initialize event of radio button required work toggle. basically, new function should work follows:

 

input: theelement process: assign click event theelement " if (this.rawvalue == savedvalue.value) {   this.rawvalue = "";   savedvalue.value = ""; } else {   savedvalue.value = this.rawvalue; }" loop on children of radio button , assign code mouseenter event: "if (savedvalue.value !== this.parent.rawvalue) {   savedvalue.value = this.parent.rawvalue }" 

 

i hope above possible.

 

tarek



More discussions in LiveCycle Designer


adobe

Comments

Popular posts from this blog

Soustraire une selection

After Effects: could not find dvaeve_dialogs.txt

Illustrator cs6 "Invalid Serial Number"