Code gets stripped from post form on submit so you’d have to filter the form as well. The code for activity submit is in global.js file in the folder _inc
You can try to add your JavaScript there but like i said code gets stripped on submit.
Thanks ! Sorry ! In fact I don’t get what you mean . I write a code and it works offline . Could you pleas check it ?
`
function addtext(val) {
document.whatsnewform.whatsnew.value += val;
}
As for the JavaScript not working; the activity posting mechanism heavily uses jquery to function and is most likely killing your code. That is why is suggest you look through global.js to understand how it’s implemented.
Thanks ! I get it . But I should learn jquery I try a new code
Try this site for a basic jquery lesson http://jqfundamentals.com/
I learn it some how . I write the following code but I have a problem . When I click on the image the text is added but when I type something in the text area it doesn’t work any more !!!
What’s the problem ?
`
$(document).ready(function(){
$(“#sml”).click(function(){
$(“#whatsnew”).append(“e”);
});
});
<img id="sml" src="s33.gif" onclick=addtext('‘) alt=”Smiley face” />
`
Your code doesn’t display correctly here can you place it between backticks `
`
$(document).ready(function(){
$(“#sml”).click(function(){
$(“#whatsnew”).val(““);
});
});
`
`$(document).ready(function(){
$(“#sml”).click(function(){
var text = $(“textarea#whatsnew”).val();
var newtext = text + ‘ : )’;
$(“textarea#whatsnew”).val(newtext);
});
});`
Thanks A lot !
Sorry for my late answer ! I didn’t have any time to test it .
I tested it and it worked .
Now I should make the plugin . Is there any document that I can use ?