hi, i''m writing a web application for products insertion, the first field is the product name. When the product name is typed i check if it already exists with an ajax call. If it exist i new advice message is create.I would like also to disable the other form do fields or hide the submit button until the product name is valid . What i would like to know is the best, or more elegant way to do that. thanks. cirpo --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You don''t need prototype to do this. You can do it just by setting the
disabled property of the form elements.
document.Form1.Name.disabled=true ... or something like that.
You can do the same with the buttons.
If you want to hide something, put it in a div and use prototype to
hide it:
<div id=''something''><input type-submit value="
save "></div>
then use: Element.hide(''something'')
On Apr 24, 4:29 am, cirpo
<alessandro.cine...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> hi, i''m writing a web application for products insertion, the
first
> field is the product name.
> When the product name is typed i check if it already exists with an
> ajax call.
> If it exist i new advice message is create.I would like also to
> disable the other form do fields or hide the submit button until
> the product name is valid .
> What i would like to know is the best, or more elegant way to do that.
>
> thanks.
>
> cirpo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Diodeus a écrit :> You don''t need prototype to do this. You can do it just by setting the > disabled property of the form elements.That''s right, however...> document.Form1.Name.disabled=true ... or something like that."document.Form1" won''t work everywhere, as name-based resolution isn''t uniform at the document level.> If you want to hide something, put it in a div and use prototype to > hide it:The div is entirely superfluous: that''s divitis. You can hide the input itself. -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@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 -~----------~----~----~----~------~----~------~--~---