Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
mandatory fields
mon
I have a dropdown in my DCR n based on the selection a container is enabled/ disabled thru form API. There are mandatory fields in the container. Now, if i select a value from the dropdown for which the container is to be disabled n try saving the dcr, i get an error message stating to enter the mandatory fields which are in the container. How do i go about solving this problem?
Find more posts tagged with
Comments
Adam Stoller
Take a look at the on-line FormAPI docs (
ts-server>http://
ts-server
/iw/help/tst/formapi/formapi_29.html#SEC29
) and look at the information regarding
IWItem.setRequired(
required
)
- I think you'd need to set an event handler for your drop-down to iterate through the various items within the container and either
enable
or
disable
the required attribute of each item therein.
Diabling is probably relatively easy. Enabling will probably require a bit more effort since I assume you don't want
every
field within the container to be required (if you do want that, enabling should be pretty easy too).
--fish
(Interwoven Senior Technical Consultant)
mon
Thanks! but i also have replicants inside the container . So, how do i get a handle to that ? also, one o fthe fields in the replicant is to be made read only.
rpatiban
It seems, I am having the same issue. Resetting to setRequired(false) is not working onItemchange event for an item(dropdown list).
The following is the code snippet, for your review. Interesting thing is setVisible is resetting. But the setRequired is not.
Mon, I wonder, if you got any resolution on this.
Any clue in this regard is really appreciated.
IWEventRegistry.addItemHandler("/categorization/hlc", "onItemChange", makeVisibleInitialCategorization);
function makeVisibleInitialCategorization()
{
// Reset category items to be invisible each time a new selection is made
resetCategorization();
}
function resetCategorization()
{
ProductLineItem.setRequired(false);
ProductLineItem.setVisible(false);
ProductsSingleItem.setRequired(false);
ProductsSingleItem.setVisible(false);
ProductsMultiItem.setRequired(false);
ProductsMultiItem.setVisible(false);
ProductsMultiISection.setVisible(false);
}
Thanks
Raghu