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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:06:38+00:00 2026-06-18T12:06:38+00:00

I have a checkbox that when clicked shows a drop down list. i just

  • 0

I have a checkbox that when clicked shows a drop down list. i just want them to change positions.

Problem is when i change positions using php, it throws an ajax error. Since each one is called in a dynamic div id, i cannot really use CSS to change it.

I have looked into just creating a top margin using nth-child in css, but haven’t had luck with that either.

Right now the check box toggles the drop down’s visibility, but the check box is below where the dropdown appears. I guess another approach is to use javascript somehow… Am I missing something? Why can’t the order be swapped

    $ret['reclength'] = new QListBox($objParent);
    $ret['length']->Name = _sp('Item Name');

    $ret['length']->AddItem("weekly", "7");
    $ret['length']->AddItem("bi-weekly","14" );
    $ret['length']->AddItem("Monthly","30" );
    $ret['length']->Display=false;      

    $ret['checkbox'] = new QCheckbox($objParent);
    $ret['checkbox']->Name = _sp('checkbox name');
    $ret['checkbox']->AddAction(new QClickEvent(), new QToggleDisplayAction($ret['length']));

    return $ret;
  • 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-18T12:06:39+00:00Added an answer on June 18, 2026 at 12:06 pm

    The rendering order will depend on your controls parent, in your case $objParent. If $objParent is a QForm then you will just need to switch their order in the QForms template. However with the behavior you are witnessing I am assuming that $objParent is a QPanel. If that is the case you will need to add a template to the QPanel and render your controls in that template in the order you desire. You could try AutoRenderChildren = true, but that will render the controls in the order in which they are delegated as children of the QPanel.

    To use CSS to position you may want to add an id to the control. That way you can reference it in your CSS and avoid any ambiguity in your selector. You just need to add a second parameter to the constructor like

    $ret['reclength'] = new QListBox($objParent, "myControlId");
    

    Just make sure that the myControlId is unique for the page. then you can access in css using #myControlId.

    Another option which may work is to set the parent to $this when you instantiate the QListBox control and then after instantiating the QCheckbox set the parent of the QListBox to $objParent. Haven’t tested this but it should work. You cann see an example of QForms in action on the QCubed Examples site. The code would look something like this. Note this is untested but should work.

    $ret['reclength'] = new QListBox($this);
    $ret['length']->Name = _sp('Item Name');
    
    $ret['length']->AddItem("weekly", "7");
    $ret['length']->AddItem("bi-weekly","14" );
    $ret['length']->AddItem("Monthly","30" );
    $ret['length']->Display=false;      
    
    $ret['checkbox'] = new QCheckbox($objParent);
    $ret['checkbox']->Name = _sp('checkbox name');
    $ret['checkbox']->AddAction(new QClickEvent(), new QToggleDisplayAction($ret['length']));
    
    $ret['reclength']->SetParentControl($objParent);
    
    return $ret; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a checkbox that when it is clicked it submits the form to
I have a checkbox that I do not want the user to have direct
In my html.beginform I have this checkbox that I want to persist. I'm not
I have a CheckBox in my application that is using the TriState mode. The
I have datagridview with checkbox column, but I want, that some of the columns
I have a checkbox that when clicked, calls a javascript program that calls grid.PerformCallback(),
I have a list with items that when clicked open a new activity (recipe
I have added a checkbox to the rows of a gridview that when clicked
I have a checkbox in a jsp page, when i clicked that checkbox control
I have a checkbox that, when clicked, checks or un-checks all the checkboxes that

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.