Hello all,
I have designed several web forms each of which links to a single form_operation.js. This JS file handles all kinds different interaction on different forms.
It works so far for me. My question is: Are there some potential problems I will have in the future?
For example, Assuem I have two forms a) login.php b) register.php.
Each form has defined different DIVs with different IDs. When login.php loads the form_operation.js, it can see some DIVs that are defined in register.php.
Most code is embedded into
/////////////// form_operation.js ////////////////////
function fun1() {}
function fun2() {}
$(document).ready(function() { // handle form 1.. } );
$(document).ready(function() { // handle form 1 & 2.. } );
$(document).ready(function() { // handle form 1 } );
Thank you