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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:23:48+00:00 2026-05-15T16:23:48+00:00

Well the title pretty much says it all. I had: $strata = new Zend_Form_Element_Select(‘strata’);

  • 0

Well the title pretty much says it all. I had:

$strata = new Zend_Form_Element_Select('strata');
$strata->setLabel('Select a strata: ')->setMultiOptions($this->stratalist)->setAttrib('onChange', 'this.form.submit()');

Then I need to use some fancy dojo form elements in other forms. So I decided to make them all look the same and did this:

$strata = new Zend_Dojo_Form_Element_FilteringSelect('strata');
$strata->setLabel('Select a strata: ')->setMultiOptions($this->stratalist)->setAttrib('onChange', 'this.form.submit()');

It shows up and looks fine, but the form is not submitted when I change the FilteringSelect. If I look at the HTML that is rendered, sure enough:

<select name="strata" id="strata" onChange="this.form.submit()">

I suspect that Dojo elements cannot or do not work like this. So how do I make this form submit when I change the FilteringSelect?

  • 1 1 Answer
  • 1 View
  • 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-15T16:23:49+00:00Added an answer on May 15, 2026 at 4:23 pm

    Here it is:

    When defining the form, give it an id:

    $this->setName('StrataSelect');
    

    or

    $this->setAttrib('id', 'StrataSelect');
    

    Then the onChange event uses getElementById:

    $strata = new Zend_Dojo_Form_Element_FilteringSelect('strata');
    $strata->setLabel('Select a strata: ')->setMultiOptions($this->stratalist)->setAttrib('onChange', "document.dojo.byId('StrataSelect').submit();");
    

    or

    $strata->setLabel('Select a strata: ')->setMultiOptions($this->stratalist)->setAttrib('onChange', "document.getElementById('StrataSelect').submit();");
    

    Why this now works and none of the “old school” submit() calls probably has something to do with dojo handling the onchange event. So submit or this.form are not objects, methods, etc etc etc.

    I don’t want to put any javascript this form depends on into the view. I want this form to be “portable”. So therefore I don’t want to use dojo.connect

    There are probably better ways to do this. So I’ll leave this unanswered for now.

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

Sidebar

Related Questions

well, the title pretty much says it all. here's a little info: i have
Well, the title pretty much says it all. I'm calling my server and when
Well, the title pretty much says it all. I start up Qt Creator, I
The title pretty much says it all. I use clojure for my major projects
The title, while long, pretty much says it all. What I have is a
The title pretty much says it all. I have a listview being populated by
Well the title pretty much sums the question. The only thing I found is
Well, the title pretty much states it. I want to be able to draw
Well, the title's pretty much it: if I sat a non-techie/my mum/twelve-year old boy/cocker
Well, the title pretty much sums it up, really. I've only just started toying

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.