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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:41:14+00:00 2026-05-18T05:41:14+00:00

I am attempting to put together a fairly complex form using dojo and dijit

  • 0

I am attempting to put together a fairly complex form using dojo and dijit widgets. The form has multiple ‘sections’ which allow the user to attach an existing object (via select tag) or create an entirely new object inline in the form.

My inputs are rendered conditionally based radio buttons and manipulated via javascript. What I am having problems doing, is conditionally making dijit widgets required based on whether the inputs are rendered or not (which itself depends on which radio button is selected.

My html (actually jsp)

<div>
    <input id="useExisting" type="radio" name="radio"  checked value="useExisting" onclick="renderExistingInput()" /> <label for="useExisting">Use Existing</label>
    <input id="new" type="radio" name="radio" value="new" onclick="renderNewInputs()"/> <label for="new">Create New</label>
</div>    
<br>
<div id="newInputs">
    <div class="row">
        <label class="label"  for="newName">Name </label>
        <span class="formInput"><input type="text" id="newName" name="newName" required="true" dojoType="dijit.form.ValidationTextBox"/></span>
    </div>
    <!-- More inputs with required="true"-->

    <br>
</div>
<div id="existingInput>
    <div class="row">
        <label class="label" for="existingSelect">Existing Object </label>
        <span class="formInput"> 
            <select name="existingSelect" id="existingSelect" dojoType="dijit.form.Select">
                <!--JSTL tags for compiling list of options --> 
            </select>
        </span>
    </div>
</div>

Accompanying javascript functions:

function renderExistingInput() {

    dojo.fx.wipeOut(getWipeArguments('newInputs')).play();
    dojo.fx.wipeIn(getWipeArguments('existingInput')).play();
}

function renderNewInputs() {
    dojo.fx.wipeOut(getWipeArguments('existingInput')).play();
    dojo.fx.wipeIn(getWipeArguments('newInputs')).play();

}

function getWipeArguments(id) {
    var wipeArgs = {
        node : id
    };
    return wipeArgs;
}

The basic ‘flow’ of user interactions is User clicks a radio button, the correct div renders as a result of that. What I want then are inputs that are not rendered to not be considered required. I’m not entirely sure how to do this. Is it possible to manipulate that particular attribute directly via dojo? Or is there a better way to do this entirely?

  • 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-18T05:41:15+00:00Added an answer on May 18, 2026 at 5:41 am

    Seem’s like My answer was staring me right in the face. I simply needed to pull together the different parts I had come across. My final function for changed the ‘required’ attribute looks like:

    function setWidgetRequiredAttributes(baseDomNodeId, requiredValue){
        foundWidgets = dijit.findWidgets(dojo.byId(baseDomNodeId));
        console.log(foundWidgets);
        foundWidgets.forEach(function(widget){
            widget.required=requiredValue;
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to put together some basic report screens. I've got some fairly complicated
I'm attempting to put together a little mashup with some twitter APIs. However, the
I'm attempting to piece together and run a list of tasks put together by
I am attempting to create a WrapPanel with seamless ImageButtons containing Artwork. I put
Attempting to insert an escape character into a table results in a warning. For
Attempting to print out a list of values from 2 different variables that are
Attempting to deploy a MOSS solution to a UAT server from dev server for
When attempting to compile my C# project, I get the following error: 'C:\Documents and
When attempting to call functions in math.h , I'm getting link errors like the
When attempting to understand how a SQL statement is executing, it is sometimes recommended

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.