you already tried something like that: </body><html> <head> </head> <body>
<script type="text/javascript" src="xxx.js"> </script> <p> The actual script is in an external script file called "xxx.js". </p> </html> Ovidio Marinho Falcao Neto ovidio...@gmail.com 88269088 Paraiba-Brasil 2011/6/6 David J. <da...@styleflare.com> > I tried this it worked on the fields but it seemed to have disabled the > rest of the web2py_ajax javascript; > > Maybe I am doing something wrong; > > <script> > > $("#myfield").valudate(number); > > > </script> > > > > On 6/5/11 7:43 PM, Anthony wrote: > > Can't you just include the relevant JS directly in the view template for > the page, or maybe include the JS string in the dict returned by the > controller, and insert it as a variable in the view? > > On Sunday, June 5, 2011 6:22:13 PM UTC-4, David J wrote: > >> How do I inject javascript in my controller from a regular web request? >> >> I read the docs it syas response.js is executed only in a component; >> >> so I have a form and I would like to add JS validators. >> >> so I try adding to the response.js = '$("myfield").validate("digits");' >> >> Of course this only works in component mode as I tried it; >> >> But now I have a single form page and I want this same javascript to work; >> >> >> How do I do that? >> >> Thanks. >> >> >> >