kinda hung here I have this and I am getting js in the popup. <%= @deposit = javascript_tag "$(''funding_transaction_deposit'').innerHTML" %> <p> <%= submit_tag ''Create'', :confirm => "Are you sure you would like #{@deposit} dibits deposited?" %> </p> I want to display the value of a text box in the confirmation popup -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
anybody? I have a text box in a form I would like the value of displayed in the confirmation box. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Jan 13, 2011 at 6:46 PM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> kinda hung here I have this and I am getting js in the popup. > > <%= @deposit = javascript_tag "$(''funding_transaction_deposit'').innerHTML" > %> > <p> > <%= submit_tag ''Create'', :confirm => "Are you sure you would like > #{@deposit} dibits deposited?" %> > </p> >What if you do this: <%= submit_tag ''Create'', :confirm => "Are you sure you would like " + $(''funding_transaction_deposit'').innerHTML() + " dibits deposited?" %>> > I want to display the value of a text box in the confirmation popup > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
compile error /Users/chabgood/web_apps_svn_working/dibspace_unfuddle/r2/app/views/funding_transactions/_form.rhtml:15: syntax error, unexpected $undefined ... you sure you would like " + $(''funding_transaction_deposit''... -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 14, 9:29 pm, David Kahn <d...-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org> wrote:> On Thu, Jan 13, 2011 at 6:46 PM, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > kinda hung here I have this and I am getting js in the popup. > > > <%= @deposit = javascript_tag "$(''funding_transaction_deposit'').innerHTML" > > %> > > <p> > > <%= submit_tag ''Create'', :confirm => "Are you sure you would like > > #{@deposit} dibits deposited?" %> > > </p> > > What if you do this: > <%= submit_tag ''Create'', :confirm => "Are you sure you would like " + > $(''funding_transaction_deposit'').innerHTML() + " dibits deposited?" %> > >Submit tag is probably going to escape any attempt at including actual javascript in the confirm text (I''d consider it a bug if it didn''t). You''re probably going to need to craft the button''s onclick by hand (You could look at the autogenerated javascript and then replace the confirm message with something similar to what David suggested. Fred> > > > > I want to display the value of a text box in the confirmation popup > > > -- > > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > > . > > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Is there no way to assign the val to a var and just putting it in the string? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I had this originally: %= @deposit = javascript_tag "$(''funding_transaction_deposit'').innerHTML" %> <p> <%= submit_tag ''Create'', :confirm => "Are you sure you would like #{@deposit} dibits deposited?" %> </p> -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 16, 4:59 pm, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Is there no way to assign the val to a var and just putting it in the > string?not the way submit_tag generates it''s javascript. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ok I am doing it the manual way, how do I get the value to show up? Are the quotes correct? <input id="funding_transaction_submit" name="commit" onclick="if (!confirm(''Are you sure you would like '' + $(''funding_transaction_deposit'') + '' dibits deposited?'') return false; return true;" type="submit" /> -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 16, 2011, at 7:23 PM, Me wrote:> Ok I am doing it the manual way, how do I get the value to show up? > Are the quotes correct? > > <input id="funding_transaction_submit" name="commit" onclick="if (! > confirm(''Are you sure you would like '' + $ > (''funding_transaction_deposit'') + '' dibits deposited?'') return > false; return true;" type="submit" />The simplest way to do the return true/false stuff is: <form action="foo" method="post" onsubmit="return confirm(''Are you sure?'');"> ... The return false (which happens if the confirm is cancelled) stops the form submission directly. I imagine you could do the same with your onclick event on the button, but putting it in the form submission makes it pretty foolproof, since the button might not be clicked (someone types Enter and the form submits without a click). Walter -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Actually what I posted is what rails produces, I copied the javascript from the page source. I was more interested how to get the div id value into the string, is it a quote issue? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 16, 2011, at 11:24 PM, Me wrote:> Actually what I posted is what rails produces, I copied the > javascript from the page source. I was more interested how to get > the div id value into the string, is it a quote issue?Oh, sorry I missed that. If you have Prototype in your page, then the syntax to get a form field''s value is $F(''theIdOfTheField'') The quotes look fine. If you don''t have Prototype, then the syntax would be something like getElementById(''theIdOfTheField'').value Walter -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
ya is this correct? <input id="funding_transaction_submit" name="commit" onclick=" return confirm(''Are you sure you would like '' + $F(''funding_transaction_deposit'') + '' dibits deposited?'') " type="submit" /> -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 16, 2011, at 11:35 PM, Me wrote:> ya is this correct? > > <input id="funding_transaction_submit" name="commit" onclick=" > return confirm(''Are you sure you would like '' + > $F(''funding_transaction_deposit'') + '' dibits deposited?'') " > type="submit" /> > >That looks right, does it work? Walter -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No I am not getting a prompt. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
For what? unless you quote the relevant part of the original email and put your responses inline anyone who happens to stumble into the middle of your issue is unlikely to be able to help. Best Wishes, Peter On Jan 17, 2011, at 5:47 PM, Me wrote:> No I am not getting a prompt. > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
<input id="funding_transaction_submit" name="commit" onclick=" return confirm(''Are you sure you would like '' + $F(''funding_transaction_deposit'') + '' dibits deposited?'') " type="submit" /> -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 17, 2011, at 5:55 PM, Me wrote:> <input id="funding_transaction_submit" name="commit" onclick=" > return confirm(''Are you sure you would like '' + > $F(''funding_transaction_deposit'') + '' dibits deposited?'') " > type="submit" />What do you see in the Firebug console or the Safari Web Inspector? You''re debugging JavaScript now, so use the tools that let you do that. Walter -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.