I guess @cus is a customer name then try this rjs code:

page[:"[email protected]_id}"].value = @cus


On Wed, Dec 2, 2009 at 6:33 PM, Chris Habgood <[email protected]> wrote:

> RJS:
>
> page[:"[email protected]_id}"].replace_html @cus
>
> Most of the page :
>
> <%= f.label 'me' %>
> <%= f.text_field_with_auto_complete :name, {:child_index => @company.id},
>  :with => "'cus[id]=' + #[email protected]} + '&mopid=' + #[email protected]} +
> '&site[name]=' + element.value",
>  :after_update_element => "function(element,value){" +
> remote_function(:url => { :controller => 'addsites', :action =>
> :getcustomersite },
>  :with => "'site[ttm]=' + element.value + '&customer[id]=' + #[email protected]}
> ") + "}" %>
>  <%= label_tag 'Customer' %>
> <%= text_field :name,"[email protected]}",:size => '6' %>
>  <%= submit_to_remote 'Add Site','Add Site', :id => "Add_Site_#{@
> company.id}",:url => { :controller => 'addsites', :action =>
> "addsitetomop", :id=> @mop},
>  :with => "'site[[email protected]}]=' + $('[email protected]}_me').value
> + '&site[cusid]=' + #[email protected]} + '&site[customer]=' +
> $('[email protected]}').value "%>
>
>
> On Wed, Dec 2, 2009 at 6:02 AM, C+++ <[email protected]>wrote:
>
>> can you show the rjs code you use, and perhaps some more of the
>> surrounding html.
>>
>> TIA
>>
>>
>> On Tue, Dec 1, 2009 at 5:59 PM, Chris Habgood <[email protected]> wrote:
>>
>>> top posting?
>>>
>>>
>>> On Tue, Dec 1, 2009 at 10:57 AM, Colin Law <[email protected]>wrote:
>>>
>>>> 2009/12/1 Chris Habgood <[email protected]>:
>>>> > Yes I know that is why I am here.
>>>>
>>>> You know what? By top posting we don't know what you are referring to.
>>>>
>>>> Colin
>>>>
>>>> > Is there something incorrect about this code?
>>>> > <%= text_field :name,"[email protected]}",:size => '6' %>
>>>> > The html output is below in firebug.
>>>> >
>>>> > <input id="name_customer_5" type="text" size="6" name="name
>>>> >>> [customer_5]">
>>>> >>> <input/>
>>>> >>> NF063
>>>> >>> </input>
>>>> >
>>>> > On Tue, Dec 1, 2009 at 7:24 AM, Johan De Klerk <[email protected]>
>>>> wrote:
>>>> >>
>>>> >> Shouldn't it be more like this:
>>>> >>
>>>> >> <input id="name_customer_5" type="text" size="6"
>>>> name="name[customer_5]"
>>>> >> value="NF063">
>>>> >>
>>>> >> On Mon, Nov 30, 2009 at 10:30 PM, Chris Habgood <[email protected]>
>>>> >> wrote:
>>>> >>>
>>>> >>> ok this code in the view:
>>>> >>> <%= text_field :name,"[email protected]}",:size => '6' %>
>>>> >>> I do an rjs.replace_html on the div and I get nothing in the text
>>>> field.
>>>> >>> When I go to firebug I see this:
>>>> >>> <input id="name_customer_5" type="text" size="6" name="name
>>>> >>> >> [customer_5]">
>>>> >>> >> <input/>
>>>> >>> >> NF063
>>>> >>> >> </input>
>>>> >>> As you can see the value is there just not in the actual text box.
>>>> >>>
>>>> >>> On Mon, Nov 30, 2009 at 2:25 PM, Colin Law <[email protected]>
>>>> >>> wrote:
>>>> >>>>
>>>> >>>> 2009/11/30 Me <[email protected]>:
>>>> >>>> > anybody?
>>>> >>>> >
>>>> >>>> > On Nov 29, 2:11 pm, Me <[email protected]> wrote:
>>>> >>>> >> This is what firebug is showing for the text_field:
>>>> >>>> >>
>>>> >>>> >> <input id="name_customer_5" type="text" size="6" name="name
>>>> >>>> >> [customer_5]">
>>>> >>>> >> <input/>
>>>> >>>> >> NF063
>>>> >>>> >> </input>
>>>> >>>> >>
>>>> >>>> >> Code:
>>>> >>>> >> <%= text_field :name,"[email protected]}",:size => '6' %>
>>>> >>>> >>
>>>> >>>> >> Why is there a "/input".  when I do an html_replace it puts  the
>>>> >>>> >> value
>>>> >>>> >> in there somwhere but never shows up.  but as you can see from
>>>> the
>>>> >>>> >> firebug output it is there somewhere.
>>>> >>>> >>
>>>> >>>> >> Not sure what is going on?  any ideas>
>>>> >>>>
>>>> >>>> I suspect the reason you have not had a reply is that most people
>>>> have
>>>> >>>> not the foggiest idea what you are trying to do or what your
>>>> question
>>>> >>>> is.  That certainly applies to me.  Perhaps you could explain what
>>>> you
>>>> >>>> are trying to do, how you are trying to do it, and what is going
>>>> >>>> wrong.
>>>> >>>>
>>>> >>>> Colin
>>>> >>>>
>>>> >>>> --
>>>> >>>>
>>>> >>>> You received this message because you are subscribed to the Google
>>>> >>>> Groups "Ruby on Rails: Talk" group.
>>>> >>>> To post to this group, send email to
>>>> [email protected].
>>>> >>>> To unsubscribe from this group, send email to
>>>> >>>> [email protected]<rubyonrails-talk%[email protected]>
>>>> .
>>>> >>>> For more options, visit this group at
>>>> >>>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>>> >>>>
>>>> >>>>
>>>> >>>
>>>> >>> --
>>>> >>>
>>>> >>> You received this message because you are subscribed to the Google
>>>> Groups
>>>> >>> "Ruby on Rails: Talk" group.
>>>> >>> To post to this group, send email to
>>>> [email protected].
>>>> >>> To unsubscribe from this group, send email to
>>>> >>> [email protected]<rubyonrails-talk%[email protected]>
>>>> .
>>>> >>> For more options, visit this group at
>>>> >>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>>> >>
>>>> >> --
>>>> >>
>>>> >> You received this message because you are subscribed to the Google
>>>> Groups
>>>> >> "Ruby on Rails: Talk" group.
>>>> >> To post to this group, send email to
>>>> [email protected].
>>>> >> To unsubscribe from this group, send email to
>>>> >> [email protected]<rubyonrails-talk%[email protected]>
>>>> .
>>>> >> For more options, visit this group at
>>>> >> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>>> >
>>>> > --
>>>> >
>>>> > You received this message because you are subscribed to the Google
>>>> Groups
>>>> > "Ruby on Rails: Talk" group.
>>>> > To post to this group, send email to
>>>> [email protected].
>>>> > To unsubscribe from this group, send email to
>>>> > [email protected]<rubyonrails-talk%[email protected]>
>>>> .
>>>> > For more options, visit this group at
>>>> > http://groups.google.com/group/rubyonrails-talk?hl=en.
>>>> >
>>>>
>>>> --
>>>>
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Ruby on Rails: Talk" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected]<rubyonrails-talk%[email protected]>
>>>> .
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>>>
>>>>
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Ruby on Rails: Talk" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<rubyonrails-talk%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<rubyonrails-talk%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to