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

  • SEARCH
  • Home
  • 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 6654419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:23:17+00:00 2026-05-26T01:23:17+00:00

I want to load a modal dialog box by clicking submit tag. but when

  • 0

I want to load a modal dialog box by clicking submit tag. but when I click on the button, it directly went to page without going to rjs file and did not render partial.
following is my code.

<span style="text-align: right">
<% form_tag "/calendar/dia_cal_view" do %>
<%= collection_select("event", "trainer_id", @trainers , :id, :name, {:prompt => true}) %>
<%= submit_tag "search" %>
<%end%>
</span>

controller code:

def dia_cal_view

@month = (params[:month] || (Time.zone || Time).now.month).to_i
@year = (params[:year] || (Time.zone || Time).now.year).to_i
@shown_month = Date.civil(@year, @month)
@trainers=Trainer.all 
@first_day_of_week = 1
 if session[:dia_Serach].nil?
    if (defined? (params[:event][:trainer_id]))
        session[:dia_Serach]=(params[:event][:trainer_id])
        #@@id=(params[:event][:trainer_id])
        @event_strips = Event.event_strips_for_month(@shown_month, @first_day_of_week, :conditions=>["trainer_id = ?",session[:dia_Serach]])            
    else
        @event_strips = Event.event_strips_for_month(@shown_month, @first_day_of_week)              
    end
else
    @event_strips = Event.event_strips_for_month(@shown_month, @first_day_of_week, :conditions=>["trainer_id = ?",session[:dia_Serach]])            
end 
 end

dia_cal_view.js.rjs

page.replace_html 'search_result', :partial => 'cal_view'

page<< "$j ('#search_result_dialog').dialog({
    title: 'calendar',
    modal: true,
    width: 500,
   height: 500,
    close: function(event, ui) { $j ('#search_result_dialog').dialog('destroy') }

});"

_cal_view.html.erb

<%= stylesheet_link_tag "event_calendar" %>
<%= event_calendar %>

The problem is that rjs file did not work. It did not go to rjs file. what should I do for this? plz help me..

  • 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-05-26T01:23:18+00:00Added an answer on May 26, 2026 at 1:23 am

    first of all your form is submitted as a html and not as a rjs request.
    You first need to change that to rjs request, change this line

    <% form_tag "/calendar/dia_cal_view" do %>
    

    use

    remote_form_tag

    or option

    remote = true

    depending on your rails version

    It should work then

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

Sidebar

Related Questions

I am actually loading a page as a modal dialog box as window.showModalDialog(url.aspx). The
When a user clicks on the button delete , I want a dialog box
I have a modal dialog in main page, then I add jPlayer to this
I want to show a pop up on page load and had a checkbox
I want to send a string data with jquery load function but its not
I want to raise a jQuery Dialog box which has 2 buttons. So that
I want to load a PDF file in a modal view controller. Since the
Browser : IE6/IE7. I want to load a new document into my html modal
I am having issues loading a jQuery modal window upon submit. I want a
I want to call a jquery onclick of a hyperlink. but now the dialog

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.