Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37910

Re: adding "onsubmit" to a form

$
0
0
by Tim Hunt.  

Well, the best solution is to avoid polluting the HTML with attribues like onsubmit just to make your JavaScript work.

Instead, use JavaScript like form.addEventListener('submit', myFunction); (or the wrapper around that provided by a library like YUI).

To get Moodle to run your JavaSript, look at $PAGE->requires->js_init_call() in Moodle code.


Viewing all articles
Browse latest Browse all 37910

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>