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

I have JS line document.getElementById(element).required=true;How do I make it work in Oracle APEX?I ha

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745584623a4634459.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信