search for: onsubmit

Displaying 20 results from an estimated 119 matches for "onsubmit".

2007 Oct 03
4
form_remote_tag :onsubmit not working.
Hi, Has anyone successfully implemented the :onsubmit option for form_remote_tag. It doesn''t seem to work for me. Is there any specific version of rails which is required for the same. Here''s my piece of code. <script> function set_tojid(){ alert(''onsubmit''); } </script> <%= form_remote_tag :upd...
2009 Mar 10
5
onsubmit for remote_form_for not working properly
I want to use onsubmit for a form validation using javascript on remote_form_for for this i am doing something like this <% remote_form_for :timesheet, @timesheet, :url =>{:action => ''report_user''}, :html => {:onsubmit=>"return ValidateDate();" } do |f| %> // Form ele...
2006 Mar 21
4
Using onSubmit tag in form_tag?
Hi guys, I have been working on a form that would use javascript to validate the data before submitting it, and from my view.rhtml I have a statement like this: However such a statement generates a HTML tag that looks like this: <form action="/users/Login?onSubmit=validate%28%29" method="post"> Seems like Rails thinks it is a parameter instead of an option, so what I tried next was something like: <%= start_form_tag {:action => ''Add''}, {:onSubmit => ''validate()''} %> Sadly that doesn'...
2006 May 09
2
[Prototype] Why doesn''t calling submit() on a form result in the execution of the onsubmit event handler?
Hi, Is it normal that a call to $(''some_form'').submit() doesn''t result in the execution of an onsubmit event handler on ''some_form''? Thanks, - Rowan -- Morality is usually taught by the immoral. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060509/685db992/attachment.html
2007 Feb 07
2
form_for onsubmit
Is there a reason I can''t find any information on using the onsubmit attribute with form_for? I''d hate to *gasp* hardcode the form tag in. chad --~--~---------~--~----~------------~-------~--~----~ 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 rubyonr...
2006 Mar 22
0
Changing the onsubmit event using an RJS template
...Just a quickie, which people will probably instantly know the answer to. I''ve got a select box which I want to be able to add values to on the fly using AJAX. I''ve got the form all appearing and updating the database, however, what I want to be able to do is change the onsubmit event for the form so if someone presses enter whilst entering a new value for the select box the application will save the new value for the select box rather than submitting the form to the original action. I''ve worked out that the javascript I need can be generated with this:-...
2007 May 09
1
How can I change a form's onsubmit event handler using rjs?
...the ajax call on submit button so the form is still there after the new model is created. But if I submit the form for the second time, I want to update the formerly created model using an Ajax post. I think I could render an rjs at the end of the first submit action and the rjs should change the onsubmit event handler of the form, say: page[:form][:onsubmit] = article_path(@article) but it seems that this doesn''t work. Another problem is that "article_path(@article)" will generate something like "/article/12" with HTTP PUT method, but I need something like "new A...
2005 Dec 10
1
submit ajax form through javascript
hi all, my problem: i have a form that is sent through ajax with ajax.updater. the onsubmit function looks like this: new Ajax.Updater( { failure:''command_div'' }, ''/windows/chat_post'', { asynchronous:true, parameters:Form.serialize(this } ); return false; this works fine when I submit the form by pressing the submit bu...
2006 Nov 23
3
Prototype Safari onSubmit Issues
...(Win) and FF, but Safari doesn''t seem to take the onChange too well. Upon the return key, it blanks out the form. Upon tabbing to the next field (actually the next form), I get the results. <form name="form1" id="form1" action="#" method="post" onSubmit="return false;"> <input class="formentry" type="text" id="x_hotel" size="20" value="" onChange="getNames(this.form)" /> </form> I''ve tried taking out the onSubmit altogether, as well as tried onSubmit=&q...
2006 Apr 10
3
form_remote_tag : additional onsubmit funct. possible ?
Is there a way to add onsubmit functionality to a form_remote_tag with an additional javascript directive? eg I''d like for an inline javascript to make the form''s div container hidden as soon as the button is pressed to avoid having it possibly get pressed again ( sometimes the rails response is slow enoug...
2006 Jul 26
0
Ajax and onsubmit
I''ve worked through the depot app and would like to use the ajax submit ability, but call it from a textbox''s onblur event. By using onblur I can submit the form, but the ''onsubmit'' part isn''t fired. Is there a way to either fire the onsubmit event, or to copy that code into a text_field? I tried a direct copy from the source of the form just to test it out without success. the following didn''t work for item 4: %= text_field ''item'...
2006 Jul 05
1
Prototype Based Validation with form_remote_tag
Hello, I am attempting to use validation.js from http://tetlaw.id.au/view/blog/really-easy-field-validation-with-prototyp e/ with form_remote_tag. The rails form helper binds the needed Ajax.Updater to the onSubmit action of the form. The validation.js also attempts to bind to the onSubmit of the form. The logic that is needed is if( valid.validate() ) { ...Ajax.Updater... } where valid is the validation object How can I add this logic to the onSubmit that is added by the FormHelper in the rails fram...
2006 Jun 12
0
javascript form events (onsubmit) in RHTML
what''s the trick for adding an onSubmit hook when using the start_form_tag? I can''t seem to find anything. I''m assuming that I can do it, no? Thanks! -- Posted via http://www.ruby-forum.com/.
2008 Feb 08
0
javascript parameter problem with onsubmit
Hi I have this problem: <script> var param1 = ''field3''; </script> <script> var param2 = ''field3''; </script> <script> var param3 = ''field3''; </script> <%= submit_tag ''Next'', {:onsubmit => ''return validate_options(param1,param2,param3);''} %> function validate_options(params) { alert (params); return false; } This does not seem to print out value param3. I only get that popup saying [object HtmlFormElement] Its done like this since...
2006 Oct 20
1
Event.observe vs. element.onxxx =
What are the pros and cons of using Event.observe vs. element.onxxx = somefunction ? I noticed that a lot of sau code doesn''t use Event.observe. For example, InPlaceEditor uses this.form.onsubmit = this.onSubmit.bind(this); In my code I''ve made a habit of using the equivalent (for example): this.onSubmitListener = this.onSubmit.bind(this); Event.observe(this.form,''submit'',this.onSubmitListener); So that in my "dispose" methods I can cleanup prop...
2008 Apr 09
13
submitting an ajax form via javascript not rendering
...sorry, its not very pretty. <SCRIPT type="text/javascript"> function submit_form(obj, form_id) { document.getElementById(form_id).submit(); } </script> ..... <form action="/assignment/update_assignment/16" id="frm_16" method="post" onsubmit="new Ajax.Request(''/assignment/update_assignment/16'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this) + ''&amp;authenticity_token='' + encodeURIComponent(''***'')}); return false;"> <div style="margin:...
2009 Aug 04
6
form_for
hi everybody... I have a form_for in that, onclicking submit button i am calling a javascript for validation.If validation fails that form_for doesnt do anything.But even the validation fails it goes to the controller and action. here my code: <%form_for :promotion_code,
2006 Jul 26
7
syntax for specifying :html fallback on form_remote_tag
Has anyone gotten the :html option for specifying a ''fallback'' action if javascript''s not enabled working on form_remote_tag (or remote_form_for)? I can''t figure out how to specify the action that''s supposed to be invoked if js _is_ enabled. Or maybe I''m just misunderstanding how this thing is supposed to work. I was assuming
2007 Jul 12
1
remote_form_for behavior on javascript submit();
..."this.form.submit();" %> <% end %> please know that the :method => :put is in there to send the request to my RESTful update method. When i change the text area it does in fact submit the form, but not through AJAX. Instead it sends it as a normal html form and ignores the onsubmit attribute which reads: onsubmit="new Ajax.Request(''/accounts/1/users/1/gss/performance_goals/ 1'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" Ive tried using the observe_form helper and it behaves the same way. The only way i...
2007 Apr 10
0
Form.serialize(this) returning empty string in onSubmit, Ajax.Update context, works in Firebug watch
This page is ripped from a real application, but its been simplified for debugging, turning off authentication and hiding Secret SauceĀ®. So if you try Form.serialize(''bio_form'') in Firebug you''ll get a url-encoded string back. The parameters to the Ajax.Updater() call a wrapper around Form.serialize which should present an alert with the url-encoded string. It