$(function(){
$("#myForm").submit(function(){
   var error="";
   $("#myTable tr td:nth-child(even)").each(function(){
     if(!$(this).find("[EMAIL PROTECTED]:checked").size())
       error=error + $(this).prev("td").text() + "<br />";
   });
   $("#error").html(error);
   return error=="";
});});

myTable is the id of your table.

On 1/18/07, Blair McKenzie <[EMAIL PROTECTED]> wrote:

Try
error = error + $(this).parent().parent().find("td:first").text();

Blair

On 1/17/07, Jamal Arbib <[EMAIL PROTECTED]> wrote:
>
> hi i am very new to this group
> i try to display the text of  the first  TD if  no  INPUT radio  of the
> second  TD  is checked.
>
> i try this code , it return all TD 's text.
>
> $(document).ready(function(){
>      var error="";
>       $("#myForm").submit( function() {
>               $("[EMAIL PROTECTED]'radio']").each(function() {
>                     if(!$(this).checked){
>                         error = error+
> $(this).parent().parent().find("td").text();
>                     }
>                 });
>
>               $("#error").html(error);
>       });
> });
>
> <....>
>
>     <tr>
>             <td class='hotel1'>Situation de l hotel  </td>
>             <td>
>                 insatisfait    <INPUT  type='radio'           value='1'
> name='questionnaire[hotel1]'>
>                 moyen        <INPUT  type='radio'           value='2'
> name='questionnaire[hotel1]'>
>                 bien            <INPUT  type='radio'
> value='3'  name='questionnaire[hotel1]'>
>                 tres bien     <INPUT  type='radio'           value='4'
> name='questionnaire[hotel1]'>
>                 excellent     <INPUT type='radio'            value='5'
> name='questionnaire[hotel1]'>
>              </td>
>   </tr>
>   <tr>
>             <td class='hotel1'>restauration </td>
>
>             <td>
>                 insatisfait    <INPUT  type='radio'           value='1'
> name='questionnaire[hotel1]'>
>                 moyen        <INPUT  type='radio'           value='2'
> name='questionnaire[hotel1]'>
>                 bien            <INPUT  type='radio'
> value='3'  name='questionnaire[hotel1]'>
>                 tres bien     <INPUT  type='radio'           value='4'
> name='questionnaire[hotel1]'>
>                 excellent     <INPUT type='radio'            value='5'
> name='questionnaire[hotel1]'>
>              </td>
>   </tr>
> <....>
> <div id="error"></div>
>
> Any help would be appreciated.
>
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/





--
Regards,
Hairiemx
http://www.hairiemx.com
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to