Prefill form-field - Joomla! Forum - community, help and support
hi,
i working on little mail-part of component. in edit-view there's editor, used format email.
well, add list-field different possible signatures. if click on signature, signature should filled editor.
is possible?
i working on little mail-part of component. in edit-view there's editor, used format email.
well, add list-field different possible signatures. if click on signature, signature should filled editor.
is possible?
yes, via javascript. e.g. if dropdown has id="signature" , textarea has id="message" you'd akin to:
msg = document.getelementbyid('message');
sig = document.getelementbyid('signature');
sigtxt = sig.options[sig.selectedindex].value;
msgtxt = msg.value;
newmsg = msgtxt + "\n--\n" + sigtxt;
msg.value = newmsg;
you'd put function called via select's onchange.
msg = document.getelementbyid('message');
sig = document.getelementbyid('signature');
sigtxt = sig.options[sig.selectedindex].value;
msgtxt = msg.value;
newmsg = msgtxt + "\n--\n" + sigtxt;
msg.value = newmsg;
you'd put function called via select's onchange.
Comments
Post a Comment