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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:14:02+00:00 2026-05-25T14:14:02+00:00

I am building a survey tool that will have different layouts and ‘inquisitorial’ processes

  • 0

I am building a survey tool that will have different layouts and ‘inquisitorial’ processes depending on the part and actual question that the user is responding too. I am building this in Coldfusion and I am using jQuery UI elements to present questions however this will lead to ui elements embedded in ui elements.

The order in which the UI elements are constructed or triggered is going to be the reverse order that they are presented in the html, so the innermost element has to be triggered first. There is a master page that has the logic that looks up the database for the question information and the specific page layout to use, which is then <cfinclude'd, this layout page may have say tabular UI elements

My solution to this has been to declare an array of UI html node names (DIV tags) along with the UI construction method. Each included element then “pushes” it’s UI information into this array.

var inst_triggers = new Array()
inst_triggers.push("#accordion@@accordion()")

finally when everything is assembled I need to trigger these UI elements, so in the master page I do the following.

$(function() {
    var it = inst_triggers.reverse();
    var it_len = it.length;

    for (e=0;e<it_len;e++){
        var trig_parts = it[e].split('@@');
    //do the jQuery UI element trigger here
    var eval_str = '$("'+trig_parts[0]+'").'+trig_parts[1];
    eval(eval_str);
    }

});

As we know “eval() ” is evil so I need an alternative to trigger or construct these page elements
Something like jQuery.uistuff.method('accordion'), but I cannot see this in the documentation (or at least I have not understood what I have read which is more likely)

Any suggestions, pointers further reading or references would be GREATLY appreciated.

Regards thanks to the collective neural network in advance !

Gus

  • 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-25T14:14:03+00:00Added an answer on May 25, 2026 at 2:14 pm

    Given the approach that you have posted, I’m not sure why you are using the @@ and splitting on it in order to determine your components. You could just as easily push an object to the “inst_triggers” array:

    var inst_triggers = [];
    inst_triggers.push({selector:"#accordion", method: "accordion"});
    
    $(function() {
        var it = inst_triggers,
            it_len = it.length;
    
        it.reverse()
    
        for ( e=0; e < it_len; e++ ) {
            $(it[e].selector)[it[e].method]();
        }
    });
    

    example: http://jsfiddle.net/bstakes/uBpk5/

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

Sidebar

Related Questions

I'm building my first real CI app. I have to build a survey system--If
I'm building a CLI survey app in Java that lets users answer multiple-choice questions.
Building the same project (without any changes) produces binary different exe-files: some small regions
Im building a web application which is a process management app. Several different employee
When building static libraries with VS2005 I keep getting linker warnings that VC80.pdb cant
In building an ASP.NET 3.5 WAP, I'm always frustrated by the feeling that no
I am building a survey, in which participants use a html form to enter
I'm building a survey w/ Codeigniter, and it's getting cumbersomely long...so I want to
One of the apps I am building needs to build a survey for users
I have searched/Googled around but I'm struggling with the following problem. I am building

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.