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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:16:21+00:00 2026-06-10T20:16:21+00:00

I have a select dropdown menu on one DIV and want the user to

  • 0

I have a select dropdown menu on one DIV and want the user to make a selection and when that happens below a different form appears on DIV below based on the choice they selected. Want to make this without having to do a post (page refresh).

Here is my /views/scripts/postjob/index.phtml

<div id="post_job">
<?php echo $this->form->setAction($this->url()); ?>
</div>
<div id="display">

</div>

Here is the controller

class PostJobController extends Zend_Controller_Action
{

public function init()
{
    /* Initialize action controller here */
}

public function indexAction()
{
    $form = new Application_Form_DivForm();

    $business = new Application_Form_BusinessCardForm();
    $calendar = new Application_Form_CalendarForm();
    $brochure = new Application_Form_BrochureForm();
    $this->view->form=$form;       

}


}

Now here is my /forms/DivForm

class Application_Form_DivForm extends Zend_Form
{
public function init()
{

    $this->setName("Business Card");
    $this->setMethod('post');   

    $this->addElement('select','type',
        array(
        'label'        => 'Post Job (select)',
        'onchange'      => 'showForm(this.value)',
        'value0'        => 'Select',
        'multiOptions' => array(
        'value1'    => 'Business Cards',
        'value2'   => 'Calendars',
        'value3'  => 'Brochures',
    ),
)
);


}

}

I am sure there are more than one way to do this but trying to find something simple. Perhaps just passing back a variable to the controller from the index.phtml and then i can do an if statement and select what form to include on the view.

  • 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-10T20:16:23+00:00Added an answer on June 10, 2026 at 8:16 pm

    Was able to solve this problem using a AJAX to post back to another controller action and then returning data back to AJAX. Still have to figure out how to submit all these subforms when they are all dynamically created.

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

Sidebar

Related Questions

I have a simple dropdown menu: <form class=feedmenu align=center> <select onchange=showRSS1(this.value)> <option value=>Select an
I have a UL LI menu that I am turning into a select dropdown
Say I have a dropdown menu... <select id=menu> <option value=1>One</option> <option value=2>Two</option> <option value=3>Three</option>
I have a system where the user can select templates from a dropdown menu
Background: I have a dropdown menu that basically works the same as the one
Two problems, one biggy one little'n. I have a lovely dropdown menu that's giving
I have a little dropdown menu similar <select> , which contolled from external js-function.
I have some code that first selects an option value in a dropdown menu
I have a drop down menu, that a user selects a criteria from, based
within a form I have a section that allows the user to build out

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.