You can do that using jQuery,

http://stackoverflow.com/questions/12287996/jquery-change-value-when-value-of-other-input-field-is-changed

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/87y4dy9izp.fsf%40dagny.auszug.com.br.
For more options, visit https://groups.google.com/d/optout.
Euan Leslie <[email protected]> writes:

> Hi
>
> I want to change the value of a field when another field is updated.
>
> Specifically, I want my e mail field to get it's data from the username,
> the domain always being the same, so username is say johndoe, e mail
> address will be [email protected]
>
> my fields look like this:
>
>     <p><h3><label class="field" for="username">Username:</label></h3>
>     <%= f.text_field :username, :style => "width: 250px" %></p>
>
>     <p><h3><label class="field" for="email">Email Address:</label></h3>
>     <%= f.text_field  :email, :style => "width: 250px" %></p>
>
> Very much a beginner with JavaScript incidentally so be gentle
>
> Help is very much appreciated.
>
> -- 
> Posted via http://www.ruby-forum.com/.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/a39507aa0805c3c7a406add16ccb8d97%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
GPG key: 0xD3D7DE92
http://paulogeyer.github.io/

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/87y4dy9izp.fsf%40dagny.auszug.com.br.
For more options, visit https://groups.google.com/d/optout.

Attachment: pgpK0sz24IaZv.pgp
Description: PGP signature

Reply via email to