最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do I make Apex text field required value dynamically - Stack Overflow

programmeradmin2浏览0评论

I have JS line

document.getElementById(element).required=true;

How do I make it work in Oracle APEX?

I have a form with select list that has values Yes/No. If a value is "Yes", 2 more text fields appear. I have done it by making dynamic action (when item is changed and gets specific value) but there was no option to set required values, so I tried to "Execute JS code".

But JS line above didn't work.

I have JS line

document.getElementById(element).required=true;

How do I make it work in Oracle APEX?

I have a form with select list that has values Yes/No. If a value is "Yes", 2 more text fields appear. I have done it by making dynamic action (when item is changed and gets specific value) but there was no option to set required values, so I tried to "Execute JS code".

But JS line above didn't work.

Share Improve this question asked Sep 30, 2014 at 12:00 Mr.PMr.P 51 gold badge2 silver badges3 bronze badges 1
  • Which version of Apex are you using? – Ian Carpenter Commented Sep 30, 2014 at 13:13
Add a ment  | 

2 Answers 2

Reset to default 3

You must add two conditionals validations for those text fields.

  1. Set field template as required, but leave it "Is Required" as "No".
  2. Add a validation for each field and make it "Conditional" setting it condition type to "Value of Item / Column in Expression 1 = Expression 2". On "Expression 1" set your select Name and "Expression 2" to desired value. Add Condition Validation Level Validation Type Condition

When you make an item required it is always required when you submit the form. You'll have to resort to page validations to check if it has a value in specific cases.

发布评论

评论列表(0)

  1. 暂无评论