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 7718987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:18:08+00:00 2026-06-01T03:18:08+00:00

i have a html select with options in my views . onchange i want

  • 0

i have a html select with options in my views .onchangei want to invoke action of my controller.
Important: i am not going to do this through Ajax because onchange my whole module is changing so i want to refresh a page each time onchange.

                   <select id="p_s">
                   <?php  foreach($this->active_services as $row){ ?>
                    <option value="<?php echo $row['ph_id'];?>"><?php echo $row['ph_name'];?></option>
                      <?php }?>
                    </select> 

the action i am calling also included the below code so i am not going to do it through ajax.

            if(!$this->_request->isXmlHttpRequest()){
             //The request was not  made with JS XmlHttpRequest
              $user = new Zend_Session_Namespace('user');
              $user_id =$user->user_id;  
              $object   = new Services();
              $active_services     = $object->Get_Current_User_Active_Services($user_id);
              $this->view->assign('active_services',$active_services );
            }

the action i am calling is invoking through both ajax and normal this time i am calling it normal.
Any idea would be helpful.

  • 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-01T03:18:09+00:00Added an answer on June 1, 2026 at 3:18 am
    <select id="p_s">
        <?php foreach($this->active_services as $row) : ?>
            <option value="<?php echo $this->url(array(
                    "module" => "yourModule",
                    "controller" => "yourController",
                    "action" => "yourAction",
                    "p_s" => $row['ph_id']
                ),
                $yourRouteName=null,
                $reset=true); 
                ?>
             ">
                <?php echo $row['ph_name'];?>
            </option>
        <?php endforeach ?>
    </select>
    

    Then

    $("#p_s").change(function() {
        window.location.href = $(this).val();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below are the options that I have in my HTML code: <label id="subn"> <select
I have this HTML: <select multiple='multiple' size='3'> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> Using
I have this HTML structure (excerpt): <td> <select id=test1 class=pub_chooser> <option value=99>All Publications</option> <option
in my .aspx page i have something like this: <select id=seltemp onchange=calltemp()> <option value=0
I have collection_select in one of my views, which properly creates a HTML <select>
I have an action that renders a view which contains this: <select id ='dynamic_select'>
I have this in courses.html.erb under app/views/students <% if @student.courses.count < Course.count then%> <%
I have a html select list menu,when user select an option he/she is redirected
I have the following HTML markup:- <select name=List1 id=l1> <option>One</option> <option>Two</option> <option>Three</option> <option>Four</option> <option>Five</option>
I have the following HTML markup: <select name=Fault class=textbox id=fault> <option>Single Light Out</option> <option>Light

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.