Jorge Godoy escribió:
> Maram <[EMAIL PROTECTED]> writes:
>
>> He all:
>>
>> I have the fields:
>>
>> field1=TextField()
>> field2=TextField()
>> field3=TextField()
>>
>> I show that in the kid template in a form:
>>
>> <span py:content="display_field_for('field1')" />
>> <span py:content="display_field_for('field2')" />
>> <span py:content="display_field_for('field3')" />
>>
>> How I do so that when entering a value in field1 or field2, show the sum
>> in the field3, without pressing the submit button...?
>>
>> I suppose that using javascript, ajax, but I don't know how to do it.
>> (And I couldn't find the suitable tutorial...)
>>
>> Have anyone any pointers to solve the problem?
>
> You'll have to take a look at MochiKit.Signal. Then you'll connect each input
> field to a sum function that'll take values from both fields and write to the
> output field.
I've read http://mochikit.com/doc/html/MochiKit/Signal.html , but I do
not understand how implementing it , in TG.
I newbie in javascript... you have same code... for that...?
>
> I usually use Label instead of TextField for output to make it clear that it
> is something that the user won't be able to change (and also because I don't
> usually store results on the database...).
>
I'm going to change field3 to label for make it clear for the user.
But I store some results on the database for optimize the sql-query.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---