Help needed strange simple text error.

Help needed strange simple text error.

by Aaron Woehler -
Number of replies: 2
I stumbled upon an something when trying to give my students an example of javascript. When adding the onchange="func()" inside of an input tag it changed onchange to Xonchange. The javascript is all escaped like the one below and was typed in the editor.

<input name="inp" onchange="func()">

Any ways to correctly present this would be appreciated.

P.S. the error appears in this version of moodle also because in the example onchange was typed not Xonchange.
Average of ratings: -
In reply to Aaron Woehler

Re: Help needed strange simple text error.

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
This is a security feature to prevent people embedding dangerous Javascript within HTML in public areas like forums.

If you really want to add some scripts like this - turn off your html editor, and enter the text using the format "Plain text".

For example:
 
  <input name="input" onChange="alert(document.cookie);">
In reply to Martin Dougiamas

Re: Help needed strange simple text error.

by Aaron Woehler -
I'm not wanting to add the script it's self to the page just show it to my students to help them get started on their assignment.
In the same page I was also wanting links to other pages. If I'm understanding things correctly the workaround would be to have a seperate example using plain text.