On Tue, Aug 25, 2009 at 8:15 AM, Thomas
Bellembois<[email protected]> wrote:
>
> Without the h.hidden field it works.
> Any idea ?
>
> Thomas
>
> Thomas Bellembois wrote:
>> Hello !
>>
>> I have a strange templating behavior.
>> Here is my code:
>>
>>        <div id="available_name">
>>        Available names
>>        % for id in range(c.number_of_available_molname):
>>
>> ${h.hidden(name='available_molname-%s.molname_id'%(id))}${h.text(name='available_molname-%s.molname_label'%(id),
>> readonly="1")}
>>            ${h.submit(name="action", value="Select name %s"%(id))}<br/>
>>        % endfor
>>        </div>
>>
>> When I look at the produced source it is correct:
>>
>>        <div id="available_name">
>>        Available names
>>            <input name="available_molname-0.molname_id" type="hidden"
>> value="1" /><input id="available_molname-0molname_label"
>> name="available_molname-0.molname_label" readonly="1" type="text"
>> value="name 1" />
>>            <input id="action" name="action" type="submit"
>> value="Select name 0" /><br/>
>>            <input name="available_molname-1.molname_id" type="hidden"
>> value="2" /><input id="available_molname-1molname_label"
>> name="available_molname-1.molname_label" readonly="1" type="text"
>> value="name 2" />
>>            <input id="action" name="action" type="submit"
>> value="Select name 1" /><br/>
>>
>>            <input name="available_molname-2.molname_id" type="hidden"
>> value="3" /><input id="available_molname-2molname_label"
>> name="available_molname-2.molname_label" readonly="1" type="text"
>> value="name 3" />
>>            <input id="action" name="action" type="submit"
>> value="Select name 2" /><br/>
>>            <input name="available_molname-3.molname_id" type="hidden"
>> value="4" /><input id="available_molname-3molname_label"
>> name="available_molname-3.molname_label" readonly="1" type="text"
>> value="name 4" />
>>            <input id="action" name="action" type="submit"
>> value="Select name 3" /><br/>
>>        </div>
>>
>> but the navigator does not render it correctly.
>> The firebug code inspector show me this code:
>>
>>     <div id="available_name"> Available names </div>
>>
>> and then
>>
>>     <input name="available_molname-0.molname_id" type="hidden"
>> value="1" />
>>     ...
>>
>> Any idea ?

I've only seen this with tables, that if you get the structure tags
wrong, cell content shows up below the table.  Does it do the same
thing in different browsers?  There are rules about where form and
field tags can go, although they seem overly nitpicky.  But there may
be a rule against putting a hidden field at that point in a <div> in
relation to the <form>; I'm not sure.  Does it work if you put all the
hidden tags right after the <form> tag?

-- 
Mike Orr <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to