javascript - Getting two different click methods to work inside single Jquery function -
I can not get these two different click functions to work at the same time. Today is my first time to use JS in any important way, so please interact with me. I have a I tried to send the deposit code above the selectable, and it was able to choose from the work. So obviously it is only running one of these methods at one time. Any ideas? Edit: I have the function Clicked on, but there is still no luck. I did not mention it before, but I am using rail. But I thought I would be fine by using a simple HTML button tag, because I need it to execute JS. Is there anything to do with this problem? Anyway, I have tried to change the train to the train, and here is what I have now: In addition, all this is happening within bootstrap modal. Submit selectable jazz list and once its items have been selected, I want users to click on a submit button. So far, the list is working, but I can not get the submit button to run my code.
$ (function () (var user_id; $ ("# selectable_ & lt;% = request.id.to_s%>"). Selection ({selected: function (event, UI) {Var results = $ ("# selection-results- & lt;% = request.id.to_s%>") empty (); $ (ui.selected) .addClass ("UI-selected"). Brother (sister) (Select "UI-selected"). Each (function, key, value) {$ (value) .frame ('*'). RemoveClass ("UI-selected");}); var index = $ ("# Selectable_ & lt;% = Request.id.to_s%> .ui-widget-content"). Html (); user_id = $ ("# selectable_ <% = request.id.to_s%> & gt; .ui-widget-content #user_id "() () () () () (//) (// user_id); // passing Rd controller (book_date and phone) window.open (location.protocol + '// Completing '+ location.host +' / '+ " Warning ("passed");} and {warnings ("Please select a user.");}}})}};
<% = button_tag "Submit" ,: Id = & gt; "Submit_button" ,: class = & gt; "BTN BTN-Small BTN-Inverse" ,: Type = & gt; "Button"%>
submit button () handler to a
click () Try changing the handler.
$ ("# submit_button"). (Function (e) {// If your button type is "Deposed", e.preventDefault (); if (user_id) {// Passing and phone variable to prevent default default action action; Phone) Window.open (location.protocol + '//' + location.host + '/' + "completes and creates and =" + user_id, "_self"); warning ("pass");} and {Alert ("Please select a user.");}});
submit () works for
form only.
Comments
Post a Comment