The following is likely what you were looking for to set the maxlength attribute in a single call of the ready() function.
<script> $(document).ready(function() { $('#student_last_name').attr('maxlength','4'); $('#student_first_name').attr('maxlength','4'); $('#student_last_name__label').attr('innerHTML','blah name'); }); </script> As has been said previously, be sure you are using this for presentation reasons and not for validation reasons as javascript/client side validation cannot be trusted. Kyle On Mon, Nov 10, 2008 at 5:12 PM, pigmej <[EMAIL PROTECTED]> wrote: > > Wes, > > If You use methods based on js or html it's easy to break them. Do not > use it, it does make any sense. Anyone can break them in few seconds. > > You really should use max/min length on server side, not user side. > > On Nov 9, 6:30 am, "Wes James" <[EMAIL PROTECTED]> wrote: >> On Sat, Nov 8, 2008 at 7:37 AM, mdipierro <[EMAIL PROTECTED]> wrote: >> >> > You can use juery to change them >> >> > <script> >> > $(document).ready(function() {$ >> > ('#student_last_name').attr('maxlength','30'); }); >> > </script> >> >> Ok this is working! Thx!! >> >> this is my app/views/layout.html with some tests that work for >> maxlength and changing label text: >> >> {{extend '../../plugin_t2/views/layout.html'}} >> <script> >> $(document).ready(function() {$ >> ('#student_last_name').attr('maxlength','4'); }); >> >> $(document).ready(function() {$ >> ('#student_first_name').attr('maxlength','4'); }); >> >> $(document).ready(function() {$ >> ('#student_last_name__label').attr('innerHTML','blah name'); }); >> </script> >> >> {{include}} >> ----------------------- >> >> I also tried to combine the lastname and firstname into one function, >> but it would only work when i put them in their own function. Can >> they be combined? >> >> -wj > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---