Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8293083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:42:39+00:00 2026-06-08T13:42:39+00:00

I have the following HTML generated by form_tag and select_tag in Rails: <form accept-charset=UTF-8

  • 0

I have the following HTML generated by form_tag and select_tag in Rails:

<form accept-charset="UTF-8" action="/deployment_group/show_workflow_list" data-remote="true" id="show_workflow_list_form" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
  <select id="folder_name_foldernames" name="folder_name[foldernames]">
    <option value="RISK_ODS" selected="selected">RISK_ODS</option>
    <option value="DETAIL_ADJUSTMENT">DETAIL_ADJUSTMENT</option>
    <option value="ODS_STAGE">ODS_STAGE</option>
    <option value="FINANCE_DM1">FINANCE_DM1</option>
  </select>
</form>

Let me know the JQuery code i need to write so that i can submit the form on change of a select value in the drop down. Please see here that when i use :onchange, it is a html option the form is submitted as html and not as a JS form. So, i cannot use :onchange.

I understood that i need to write something like this in my application.js file:

$(#folder_name_foldernames).change(function(){
    $(#show_workflow_list).submit()
});

I used the above code in application.js file
but i have to remove “require_tree .” as i get some error
so i added

$('#folder_name_foldernames').change = () ->
  $('#show_workflow_list_form').submit() 

to my deployment_group.js.coffee file (the deployment_group is my controller related the above view)

But still i dont see any change when i change the selection in the drop down.
Please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:42:41+00:00Added an answer on June 8, 2026 at 1:42 pm

    I solved the problem doing it the following way:

    <%= f.select :foldernames, options_for_select(@folders, @folders.first), {}, {:onchange=>"myfunc()"}%>
    

    and i added

    <script type="text/javascript">
    function myfunc()
    {
        $('#folder_name_foldernames').change(function(){     $('#this_form').submit(); }); 
    }
    </script>
    

    and the form is being submitted as JS instead of HTML. It would be very helpful if someone can explain me why this is being submitted as JS instead of HTML
    The same code when i write :onchange=> this.form.submit, is being submitted as HTML

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html form, which is generated dynamically: <ul class=precursorList> <li> Precursor
I have the following razor code: <form id=logon action=/security/dev method=get> @Html.AntiForgeryToken() @Html.EditorFor(x => x.UserName)
I have the following HTML: </td><td> <div id=arrow></div> </td> <form method=POST action=index.php> <input type=hidden
I have the following dynamically generated HTML <div id=1> <form name = inpForm> <input
I have the following HTML generated by an ASP.NET repeater: <table> <tr> <td><input type=hidden
I have the following html structure (which is generated and I can't change): <table
I have the following HTML code (note no closing tags on <\option> ) generated
I have a server-generated html like: <ul> <li><!-- few nested elements that form a
I have the following code in a form's submit button onClickListener: String action, user,
I've generated the following XSLT file, and have created a Form that will post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.