Caro Júnior,

Isso mesmo!!! Obrigada pela dica. O radio funcionou direitinho.
Agora o problema é com o checkbox :(
Da maneira que vc indicou, não salva todos os que estão marcados, só
salva somente um.


--- Em zope-pt@yahoogrupos.com.br, JJ (Arnaldo Janz Júnior)
<[EMAIL PROTECTED]> escreveu
> Ôpa, Gisele!
> 
> Bom, suponho que o que vc diz por não funcionar seja que o radio e o
check 
> não aparecem "checados". Pelo padrão XHTML, o valor que fará isso
acontecer 
> é definir "checked" ao atributo checked, ou seja checked="checked".
Daí, o 
> que resolveria teu problema (se for mesmo esse) é:
> 
>  <input name="ds_lotacao" type="radio" value="DA" border="0"
> tal:attributes="checked python:test(ds_lotacao == 'DA','checked',None)">
> 
> e
> 
>  <input name="graduacao:list" type="checkbox" id="graduacao:list"
> value="arquitetura" border="0" tal:attributes="checked 
> python:test(ds_graduacao == 'arquitetura','checked',None)">
> 
> Espero que seja esse o problema e tenha ajudado.
> 
> [ ]
> -- 
> JJ (|´:¬{)»
> ---------------------------------------------
> "Deus escreve certo por linhas certas. Nós é que enxergamos torto."
> ---------------------------------------------
> Em 12/09/05, Gisele Borges <[EMAIL PROTECTED]> escreveu:
> > 
> >  Pessoal,
> > Todos os tutoriais possíveis que tentei localizar não têm como exemplo
> > nenhum em formulários o radio e/ou checkbox, só text (que é moleza de
> > fazer).
> > 
> > Da maneira q está abaixo este input não funciona para o radio:
> > 
> > <input name="ds_lotacao" type="radio" value="DA" border="0"
> > tal:attributes="checked python:test(ds_lotacao == 'DA','1',None)">
> > 
> > 
> > Nem para o checkbox:
> > 
> > <input name="graduacao:list" type="checkbox" id="graduacao:list"
> > value="arquitetura" border="0" tal:attributes="checked
> > python:test(ds_graduacao == 'arquitetura','8',None)">
> > 
> > Alguém tem algum modelo?
> > 
> > Obrigada,
> > Gi
> > 
> > 
> > --- Em zope-pt@yahoogrupos.com.br, José Henrique <[EMAIL PROTECTED]>
escreveu
> > > Gisele,
> > > 
> > > Pelo código que você mandou, que mostra apenas o formulário mas
não a
> > > sua validação e a ação subsequente à sua submissão, não dá pra saber
> > > qual a razão da não gravação no
> > > BD.
> > > 
> > > Entretanto, lembre-se que os campos radio e checkbox tem uma
> > > particularidade: se nenhum deles é marcado, nenhuma informação é
> > > passada no request. É como se eles não existissem no formulário.
> > > 
> > > Zénrique.
> > > 
> > > Em 02/09/05, Gisele Borges<[EMAIL PROTECTED]> escreveu:
> > > > Pessoal,
> > > > 
> > > > Estou construindo um formulário que tem radiobutton e
checkbox. Tenho
> > > > vistos vários exemplos mas não achei nenhum com esses types.
> > > > 
> > > > Gostaria de saber se este código está correto, pois o
formulário envia
> > > > sem erros, mas não salva no banco:
> > > > 
> > > > Obrigada,
> > > > Gi
> > > > 
> > > > 
> > > > ==========================================================
> > > > 
> > > > <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en"
> > > > lang="en"
> > > > metal:use-macro="here/main_template/macros/master"
> > > > i18n:domain="plone">
> > > > 
> > > > <head>
> > > > <title tal:content="template/title">The title</title>
> > > > 
> > > > </head>
> > > > <body>
> > > > <div class="style1" metal:fill-slot="main"
> > > > tal:define="errors options/state/getErrors">
> > > > <h2><span tal:replace="here/title_or_id">content title or
> > id</span>
> > > > <span tal:condition="template/title"
> > > > tal:replace="template/title">optional template
> > > > id</span></h2>
> > > > 
> > > > <!--<pre tal:content="options/state"></pre>-->
> > > > 
> > > > <form action=""
> > > > method="post"
> > > > tal:attributes="action
> > > > string:${here/absolute_url}/${template/getId}" >
> > > > <table width="700" height="231" border="0" align="center"
> > > > cellpadding="0" cellspacing="0" bordercolor="#F3F7F8"
> > > > bgcolor="#F2F4F4" class="style1">
> > > > <tr tal:define="error errors/ds_lotacao | nothing;
> > > > ds_lotacao request/ds_lotacao | nothing;"
> > > > tal:attributes="class python:test(error, 'field error',
> > > > 'field')">
> > > > <td height="57" colspan="2" bgcolor="#D4D4D4"><div
> > > > align="center"><strong><br>
> > > > <br>
> > > > </strong></div></td>
> > > > </tr>
> > > > 
> > > > <tr bgcolor="#F8F8F8" tal:define="error errors/ds_idade |
> > nothing;
> > > > ds_idade request/ds_idade | nothing;"
> > > > tal:attributes="class python:test(error, 'field error',
> > > > 'field')">
> > > > <td width="43%" height="60"> 3 - Faixa etária </td>
> > > > <td valign="top"><div tal:content="error">Validation error
> > > > output</div>
> > > > <input name="ds_idade" type="radio" value="19" border="0"
> > > > tal:attributes="checked python:test(ds_idade == '19','1',None)">
> > > > de 19 a 24 anos<br>
> > > > <input name="ds_idade" checked type="radio" value="25"
> > > > border="0" tal:attributes="checked python:test(ds_idade ==
> > > > '25','1',None)">
> > > > de 25 a 29 anos</td>
> > > > </tr>
> > > > 
> > > > <tr bgcolor="#F8F8F8" tal:define="error errors/ds_area|
> > nothing;
> > > > ds_area request/ds_area | nothing;"
> > > > tal:attributes="class python:test(error, 'field error',
> > > > 'field')">
> > > > <td height="76"> 5 - Áreas </td>
> > > > <td valign="top"><div tal:content="error">Validation error
> > > > output</div>
> > > > <input name="ds_area" type="checkbox"
> > > > value="direitointernacional" border="0" tal:attributes="checked
> > > > python:test(ds_area == 'direitointernacional','1',None)">
> > > > direito internacional<br>
> > > > 
> > > > <input name="ds_area" type="checkbox" value="direito"
> > > > border="0" tal:attributes="checked python:test(ds_area ==
> > > > 'direito','1',None)">
> > > > direito<br>
> > > > <input name="ds_area" type="checkbox"
> > value="economia" border="0"
> > > > tal:attributes="checked python:test(ds_area ==
'economia','1',None)">
> > > > economia </td>
> > > > </tr>
> > > > <tr bgcolor="#E5E5E5" tal:define="error errors/ds_realizacao |
> > > > nothing;
> > > > ds_realizacao request/ds_realizacao |
> > nothing;"
> > > > tal:attributes="class python:test(error, 'field error',
> > > > 'field')">
> > > > 
> > > > </tr>
> > > > </table>
> > > > <div align="center" class="style1"><br>
> > > > <input name="form.button.Register" type="submit" value="Enviar">
> > > > <input name=btnReset type=reset value="Limpar">
> > > > </div>
> > > > <p>
> > > > </p>
> > > > <input type="hidden" name="form.submitted" value="1" />
> > > > </form>
> > > > </div>
> > > > 
> > > > </body>
> > > > </html>





Para enviar uma mensagem: zope-pt@yahoogrupos.com.br
Para desistir envie uma mensagem em branco para: [EMAIL PROTECTED] 
Links do Yahoo! Grupos

<*> Para visitar o site do seu grupo na web, acesse:
    http://br.groups.yahoo.com/group/zope-pt/

<*> Para sair deste grupo, envie um e-mail para:
    [EMAIL PROTECTED]

<*> O uso que você faz do Yahoo! Grupos está sujeito aos:
    http://br.yahoo.com/info/utos.html

 


Responder a