logo
Tags down

shadow

Submitting a rails remote_form with external submit button


By : John G
Date : October 17 2020, 11:12 AM
wish of those help Ok so I figured it out from repeated googling. And thanks tadman for sending me down the right path!
code :


Share : facebook icon twitter icon

Having JQuery/JS submit a Ruby on Rails button after finishing, as compared to submitting a rails form?


By : user2926532
Date : March 29 2020, 07:55 AM
I wish did fix the issue. So basically on one page I have a Rails form that has a JQuery link on it, and in the JQuery handler i have the line , You can use a CSS selector for any object. For example:
code :
<button class="my-target">Label</button>
$('.my-target').click();
<%= button_to 'Renew', [:renew, post], method: :post, class: 'my-target' %>

Submitting two different forms with an external Submit button not working properly


By : Alejandro Kentaro Ce
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further You could try assigning the color inputs from the secondary form to your 'master' form. Simply using on any input would assign that input to the other form regardless of where it is on the page.
code :
// When the 'master' form is submitted...
$("#masterForm").on("submit", function(e) {
  "use strict";
  // Stop the default action
  e.preventDefault();
  
  if ($("input[type='radio']:checked").length === 0) {
    alert("You must check at least one color option.");
    return false;
  }
  
  // *for logging*
  // write the contents of the submitted data
  $("p").html("submitted data: " + $(this).serialize());
  console.log("submitted data: " + $(this).serialize());
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<form id="masterForm">
  <input name="someField" type="text" value="test value">
</form>

<form id="anotherForm">
  <label>
    <input name="color" type="radio" value="blue" form="masterForm">Blue
  </label>
  <label>
    <input name="color" type="radio" value="red" form="masterForm">Red
  </label>
</form>

<!-- Submit button outside of the form -->
  <button type="submit" form="masterForm">Submit</button>

<p></p>
// When the 'master' form is submitted...
  $("#masterForm").on("submit", function(e) {
  "use strict";
  // Stop the default action
  e.preventDefault();

  var submissionData = $(this).serialize();
  submissionData += "&color=" + $("#slaveForm").find("input[name='color']:checked").val()

  // do stuff ...
});

Rails - Submitting multiple forms with one submit button


By : user741852963
Date : March 29 2020, 07:55 AM
I wish did fix the issue. In my application I have a page for editing all users however I would like it so that I only have to click one submit button to update the users' details but at the moment I can only edit one and click the 'Update User' button to change that one user's details. , Against:
code :
<%= form_for user do |f| %>
<%= fields_for "users[]", user do |f| %>
"users"=>{"user_id1"=>{"attr1"=>"value1"}, "user_id2"=>{"attr1"=>"value1"}
def update_collection
  # Update users here
end
resources :users do
  collection do
    match 'update_collection',  via: [:put, :patch]
  end
end
<%= form_tag update_collection_users_path, method: :put do |form| %>

Rails : Submit button not submitting values


By : Carlos Garaga
Date : March 29 2020, 07:55 AM
will be helpful for those in need I solved this problem by moving my JS to onReady as turbolinks was caching the page.

Rails Submit button not submitting


By : hannah seligson
Date : March 29 2020, 07:55 AM
I wish did fix the issue. My issue ended up not being HTML based, but Rails based in the end.
My static element that is populated by a param was causing the issue.
code :
<%= f.text_field :statement_type, :id => "disabled", :value => (params[:statement_type]), readonly: true %>
Related Posts Related Posts :
  • How to display different values in a jqGrid column
  • JQuery nested ul-li tree, searching and applying
  • jQuery - Trying to create an 'endless slideshow' of images
  • Jquery, make a loop with a simple animation
  • Simple jQuery callbacks break in IE
  • is it possible to remove an html comment from dom using jquery
  • Change href file but not query string with jQuery
  • Is there a way to prevent overlapping events in jQuery FullCalendar?
  • turn serialized form into invisible form and submit
  • using jQuery to reload entire page
  • Jquery remove drawn line added via jquery svg library
  • jquery hover on one ul at a time
  • Open URL while passing POST data with jQuery
  • jQuery get all ids on page
  • jQuery: create regex pattern from variable
  • List of items is too long, how do we detect condition and resolve it?
  • jQuery - replace loop by className
  • jquery $this problem
  • jQuery split only words that do not have specific class
  • jQuery - datatables, how to get column id
  • jQuery fadeIn() not fading in
  • My click on DIV is not getting triggered
  • JQuery collapsible tabs problem?
  • Highlight dates in specific range with jQuery's datepicker
  • Howto change all links to text in a div tag
  • jQuery: textbox keyup firing twice
  • Removing jquery imgareaselect plugin from element
  • Jquery script linking problem?
  • prototype: keep an element in view upon scrolling
  • Set focus on div contenteditable element
  • JSON JQuery Flickr
  • jquery modal window
  • Simple jQuery: Adding multiple values to textboxes
  • jquery append and remove element problem
  • Change background color of JQuery slider
  • Jquery: Adding multiple values to textboxes (round two)
  • loading page framents with Jquery AJAX
  • jQuery coverflow like script?
  • jquery datatables question
  • JQuery Select Input Fields Except Hidden
  • How do I get actual image width and height using jQuery?
  • jCarousel Autoscroll navigation setup
  • How can I show just the icon of the currently selected option?
  • How do I send an array in an .ajax post using jQuery?
  • jquery datatables using classic .asp
  • Get the value of id from spans inside a div using jquery
  • JQuery input elements
  • jQuery onmouseover + onmouseout / hover on two different divs
  • jQuery animate background position in chunks?
  • Extending the Google CDN version of jquery to add datepicker
  • why does my jQuery drop-down hide when I hover it?
  • how to avoid function conflicts between jquery plugins
  • jQuery - how to set attr for 'this'..?
  • ASP.NET MVC jQuery on IIS 6.0
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org