>From my earlier email:

db.define_table("student",
   SQLField("last_name","string",length=30,default=""))

On Mon, Nov 10, 2008 at 8:44 PM, mdipierro <[EMAIL PROTECTED]> wrote:
>
> Does your db.table.last_name have a default value?
>
> On Nov 10, 8:52 pm, "Wes James" <[EMAIL PROTECTED]> wrote:
>> I have been doing this.  But I am now writing my own form as the
>> generic one does not work well for some of my fields.  I need to add
>> "helper" text after some of the fields to give extra info to the
>> students about the field.  I am having problems with the form creation
>> but Massimo (and whoever else) hopefully can take a look at it and
>> find out why the fields aren't being populated with values from the
>> DB. This is what I'm trying to get to work:
>>
>> <input name="last_name" value="{{=form.latest.last_name}}" />
>>
>> All I get is None for the field value on the form.
>>
>> -wj
>>
>> On Mon, Nov 10, 2008 at 7:10 PM, Kyle Smith <[EMAIL PROTECTED]> wrote:
>>
>> > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to