Hi everyone.
Please could anyone tell me how disable form elements in this
situation:
<script>
function offTr(id){
$(id).hide();
}
</script>
<form action="" method="post">
<table>
<tr id="tr1">
<td>
<input type="text" name="inp1" />
</td>
</tr>
<tr id="tr2">
<td>
<input type="text" name="inp2" />
</td>
</tr>
<tr>
<td>
<input type="radio" name="rad"
onclick="offTr(''tr1'');"> Off first
<input type="radio" name="rad"
onclick="offTr(''tr2'');"> Off second
</td>
</tr>
<tr>
<td>
<input type="submit" />
</td>
</tr>
</table>
</form>
If click on radiobutton then one of the "tr" hides with its input, but
if submit a
form, input that contains hided tr, will sended throw form, and its
value will be in POST array!
How can i solve this problem? I need very simple solution, because
this need to do asap!
Any ideas?
--
Regards,
Igor
mailto:igor.vavrjin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
<input type="text" name="inp1" /> should be <input type="text" id="inp1" name="inp1" /> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
> <input type="text" name="inp1" />> should be <input type="text" id="inp1" name="inp1" />Sorry, of course you are right (just a typing error, in real code its all right), but this is not solve the problem :) -- Regards, Igor mailto:igor.vavrjin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Igor Vavrjin wrote:> Hi everyone. > > Please could anyone tell me how disable form elements in this > situation: > > <script> > function offTr(id){ > $(id).hide(); > } > </script> > ...Do you mean disabled as in avoiding posting values to the server? $(id).disabled = true; - Ken Snyder --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
> Do you mean disabled as in avoiding posting values to the server?> $(id).disabled = true;Oh! its great. Thans a lot! I thought that its by default (disable when hides element). -- Regards, Igor mailto:igor.vavrjin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---