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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:21:06+00:00 2026-05-27T21:21:06+00:00

In jQuery I would do: var foo = jQuery(form); foo.each(function(){ this.find(.required).each(function(){…}) }) This would

  • 0

In jQuery I would do:

var foo = jQuery("form");
foo.each(function(){
  this.find(".required").each(function(){...})
})

This would find every required field in a form currently processed.

But as I have to use Dojo I’m kind of lost. In Dojo you need to use dojo.forEach()

    var foo = dojo.query("form");
    dojo.forEach(foo, function(self,i){

    // And now I have no idea on what to use the forEach. 
    // The "self" parameter is the form node. So now I 
    // would need something like `self.forEach`
    // But that obviously does not work

    }
  • 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-27T21:21:07+00:00Added an answer on May 27, 2026 at 9:21 pm

    You just need to do another query again, like you did in the first level. The philosophy in Dojo is that things are usually less “magic” then they are in jQuery.

    var forms = dojo.query("form"); //No second argument; Searches whole document
    dojo.forEach(forms, function(form){
        var requireds = dojo.query(".required", form);//Only search under 
                                                      // the current form.
        dojo.forEach(requireds, function(required){
            /* do stuff*/
        });
    })
    

    I also took the liberty to change the name of the self variable (since unlike jQuery, Dojo does not change the this) and removed the optional i parameter from the forEach.

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

Sidebar

Related Questions

I tried this code: $.post('/script', function(result) { var foo = $(result).find('#foo'); $('#result').html(foo); }); Here's
I'm trying to come up with a reusable JS or jQuery function that would
Basically what I am after is this, var foo = 'I am foo!'; alert(window['foo']);
I would like to style placeholder text in different color for each text field.
I'm searching for a jQuery plugin that does this. for example: <label><input type=checkbox depends_on=foo=5
Given var oJQ = $('#foo').children(); , how would you also include foo with the
I would like to find out if a Javascript variable exists. This is what
Is there any reason why JQuery would not work when used in an ASPX
I'm new to jQuery and would like to parse an XML document. I'm able
I'm new to jQuery and would like to know if it is possible to

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.