|
|||||||
![]() |
Forum Index > General > General Support |
|
|
Execute Javascript and Ajax on Static pages
|
|||
| | | Printable Version |
|
john | ||||||||
|
Hello, PHP Formatted Code <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="ajax.js"></script> <script type="text/javascript" src="funcoes_inst_dep.js"></script> <title>Registo de novo data logger</title> </head> <body onload="buscaInstituicoes()"> <div class="story-body"> <div class="glfform"> <form id="form1" enctype="multipart/form-data" method="post" action="http://localhost/public_html/staticpages/index.php?page=procedimentos_programados"> <div class="required"><label for="uf">Instituição/Organização:</label><select id="uf" name="uf" onchange="buscaDepartamentos(this.value)></select></div> <div class="required"><label for="departamento">Departamento/Secção:</label><select id="departamento" name="departamento"> <option value="">selecione primeiro a instituição</option> </select></div> <div class="required"><label for="name">Nome data logger:</label><input type="text" maxlength="40" id="name" name="name" /> </div> <div class="required"><label for="email">Modelo:</label><input type="text" maxlength="30" id="modelo" name="modelo" /></div> <div class="required"><label for="message">Mensagem:</label><textarea cols="28" rows="5" id="message" name="message"></textarea></div> <p style="text-align: center;"><input type="submit" value="Enviar" id="submit" /></p> </form> </div> </div> </body> </html>
---------------------------------------- |
![]() Chatty ![]() Group Comfort Level:: +3 ![]() ![]()
Registered: 08/04/09 |
||||||||
|
|||||||||
|
Mark | ||||||||
|
John, I can't really think of a reason why JavaScript or AJAX would not work in a static page, we use JavaScript all the time with the MooTools widgets, which all use static pages. PHP Formatted Code <script type="text/javascript"> window.onload = functionname(); </script>
glFusion - Enhanced Content Management |
![]() Admin Group Comfort Level:: +104 ![]() ![]()
Registered: 10/21/05 |
||||||||
|
|||||||||
|
john | ||||||||
|
I know it´s not necessary put html tags, but when i´m not getting anything I put for see some diference... but it was the same... ---------------------------------------- |
![]() Chatty Group Comfort Level:: +3 ![]() ![]()
Registered: 08/04/09 |
||||||||
|
|||||||||
|
john | ||||||||
|
No, it´s not working... I put the code like this: PHP Formatted Code <script type="text/javascript" src="http://localhost/public_html/ajax.js"></script> <script type="text/javascript" src="http://localhost/public_html/funcoes_inst_dep.js"></script> <script type="text/javascript"> window.onload = buscaInstituicoes(); </script> <div class="story-body"> <div class="glfform"> <form id="form1" enctype="multipart/form-data" method="post" action=""> <div class="required"> <label for="uf">Instituição/Organização:</label> <select id="uf" name="uf" onchange="buscaDepartamentos(this.value)></select></div> <div class="required"> <label for="departamento">Departamento/Secção:</label> <select id="departamento" name="departamento"> <option value="">selecione primeiro a instituição</option> </select> </div> <div class="required"> <label for="name">Nome data logger:</label> <input type="text" maxlength="40" id="name" name="name" /> </div> <div class="required"> <label for="email">Modelo:</label> <input type="text" maxlength="30" id="modelo" name="modelo" /> </div> <div class="required"> <label for="message">Mensagem:</label> <textarea cols="28" rows="5" id="message" name="message"></textarea> </div> <p style="text-align: center;"><input type="submit" value="Enviar" id="submit" /></p> </form> </div> </div>
---------------------------------------- |
![]() Chatty Group Comfort Level:: +3 ![]() ![]()
Registered: 08/04/09 |
||||||||
|
|||||||||
|
Mark | ||||||||
|
If you can provide all the files I'll do a little testing later this morning. A couple of other thoughts: glFusion - Enhanced Content Management |
![]() Admin Group Comfort Level:: +104 ![]() ![]()
Registered: 10/21/05 |
||||||||
|
|||||||||
|
john | ||||||||
|
ok, this is the link for a zip file containing my files, ---------------------------------------- |
![]() Chatty Group Comfort Level:: +3 ![]() ![]()
Registered: 08/04/09 |
||||||||
|
|||||||||
|
john | ||||||||
|
I know it´s not a good way to do, but when I put these code: PHP Formatted Code <body onload="buscaInstituicoes()"> (...) </body>
PHP Formatted Code (...) <select name="uf" id="uf" onchange="buscaDepartamentos(this.value)"> (...)
---------------------------------------- |
![]() Chatty Group Comfort Level:: +3 ![]() ![]()
Registered: 08/04/09 |
||||||||
|
|||||||||
|
john | ||||||||
|
Well... I´m feeling like stupid... I don´t know how and It´s seems hardly do belive but it working now and the only thing I need to put it was ";" at the end of function call like this: PHP Formatted Code (...) //N o w <select id="uf" name="uf" onchange="buscaDepartamentos(this.value);"> </select> (...)
PHP Formatted Code (...) //B e f o r e <select id="uf" name="uf" onchange="buscaDepartamentos(this.value)"> </select> (...)
---------------------------------------- |
![]() Chatty ![]() Group Comfort Level:: +3 ![]() ![]()
Registered: 08/04/09 |
||||||||
|
|||||||||
|
Mark | ||||||||
|
If I had a dollar for every missing semi-colon I've forgotten, I would be a very rich man glFusion - Enhanced Content Management |
![]() Admin Group Comfort Level:: +104 ![]() ![]()
Registered: 10/21/05 |
||||||||
|
|||||||||
|
| All times are CDT. The time is now 08:55 am. |
|
|