Setting field/control "required" property with script
Am using LiveCycle 8.2.1x and Acrobat Pro Extended 9.1.2.
I want to change one control's "required" property based upon the user's input in/on another control (a drop-down list selection). Can it be done with FormCalc or Javascript? If so, how?
Hi Brian,
You can use the nullTest property.
To make TextField1 mandatory
TextField1.validate.nullTest = "error";
To make TextField1 optional
TextField1.validate.nullTest = "disbled";
Regards
Bruce
Similar Messages
-
Set field to required using javascript
Hi Everyone
I am looking for a method to set a field to required inside javascript. i.e.
if (this.rawValue==1)
{ ConditionalField.Setattribute=required}
else
ConditionalField Setattribut=optional
Thanks for your help
Regards
MeirThanks Peter and sorry for the mixup. Fortunately I found a solution so no need to repost it even.
Regards
Meir.
P.S. Keep up the good work on the forum! -
Setting the layer color property with javascript
Is it possible to set a layer's color in the layers palette using javascript?
By default everything shows up with no layer color but if you right click (ctrl-click) on a layer you have the option to change the color to Red, Orange, Yellow, etc.
My question is can I do this with a script?
I can lock a layer, change it's visibility and opacity, but I can't seem to find any reference to that particular property.
Any help is appreciated.
Thanks,
ZaraThis will set the active layers colour....
layerColour("Violet");
function layerColour(colour) {
switch (colour.toLocaleLowerCase()){
case 'red': colour = 'Rd '; break;
case 'orange' : colour = 'Orng'; break;
case 'yellow' : colour = 'Ylw '; break;
case 'yellow' : colour = 'Ylw '; break;
case 'green' : colour = 'Grn '; break;
case 'blue' : colour = 'Bl '; break;
case 'violet' : colour = 'Vlt '; break;
case 'gray' : colour = 'Gry '; break;
case 'none' : colour = 'None'; break;
default : colour = 'None'; break;
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
desc.putReference( charIDToTypeID('null'), ref );
var desc2 = new ActionDescriptor();
desc2.putEnumerated( charIDToTypeID('Clr '), charIDToTypeID('Clr '), charIDToTypeID(colour) );
desc.putObject( charIDToTypeID('T '), charIDToTypeID('Lyr '), desc2 );
executeAction( charIDToTypeID('setd'), desc, DialogModes.NO ); -
Can't set bean1's int property with bean 2's int property
Using JDeveloper 3.2.3 (with JSP 1.1), the following fails to compile:
<jsp:useBean id="user" type="pkg.User" scope="session"/>
<jsp:useBean id="user2" type="pkg.User"/>
<jsp:setProperty name="user2" property="id" value=" <jsp:getProperty name="user" property="id"/> "/>
The compile error is...
Error in attribute list: Unable to convert constant to property type: int
The pkg.User id property is an int. If I change the code to set a String property it works fine!
The workaround is to do the following:
<jsp:setProperty name="user2" property="id" value=" <%= user.getId() %> "/>
However, I prefer the XML syntax.
Environment:
JDeveloper 3.2.3 (build 1018)
Windows 2000
nullUnfortunately, this is the major limitation of using cooperating beans in a JSP. The JSP tag translation mechanisms just don't handle passing non-String parameters between beans very well. I have half a mind to write a tag extension where you can pass in a source bean and property and a destination bean and property and the tag will generate the code to set the destination property based on the source property.
Unless someone already has one out there, I may just do this and pass it around. Something like:
<jfh:passObject
source="bean1" source_property="id"
dest="bean2" dest_property="id"
/>Of course, I would have to worry about ClassCastExceptions if the source property and destination property are not convertible, but it would be useful nonetheless to be able to pass around Java objects without having to write the code into the JSP.
Ideas, thoughts?
John H. -
I would like to make a field required based on the which radio button is selected. Example:
Next available date
Specific date
If the user selects specific date then the following date field need to be required.
Thanks you any assistance.
ParreYou can write in the click event of the radiobutton: Java Script
if(RadioButton1.rawValue == "Value to Compare"){
SpecificDate.mandatory = "error";
else{
SpecificDate.mandatory = "disabled";
Thanks
Srini -
Problem with changing required property based on another field using EL
Hi,
In my form, I want to set required property should be true or false for field 'B' based on value of field 'A'.
Value of 'A' is from 1 to 10 as choice list.
If 'A' value is 1 then i want i want to set required property of 'B' is false.otherwise the field 'B' should be required.
I set auto Submit to true for field 'A' and 'A' assigned as partial trigger for 'B'.
In required property of 'B', i given
#{bindings.ScheduleLevel.inputValue!=1}
Now, it is working fine if i try to change the list value of 'A' from 2 to 1 or 1 to 2 or more in the existing record.
But, if i click create button, then if i choose 1 for 'A', then the 'B' field is not changing from required to non-required.
my jdev version is 11g.
Any suggestions please.
Thanks in advance,
SANThis would not work as validations would fire before. So you will have to accomplish this using a valuechangelistener like this.
Keep a boolean variable which captures whether field is required or not let' say brequired
for field A
set immediate=true, autosubmit=true
then in value change listener of A you use the code as follows:-
public void onAChange(ValueChangeEvent valueChangeEvent) {
Object value=valueChangeEvent.getNewValue();
if(value!=null&&!value.toString().trim().equalsIgnoreCase("")){
setBrequired(true);
FacesContext.getCurrentInstance().renderResponse();
else{
setBRequired(false);
FacesContext.getCurrentInstance().renderResponse();
} -
How to set a signature field as 'Required' with selection of a Check Box
I have a set of 3 check boxes and would like to set a unique combination of pre-existing signature fields as 'required' for each respective check box.
Given Check Box names of Box1, Box2, Box3 and Signature Field names of Sig1, Sig2, Sig3, can someone provide example JavaScript for setting Sig1 and Sig3 as required upon a Mouse Up of Box 1?
Otherwise, can someone let me know if this might be more trouble than it's worth?
Thanks!Sorry to keep you waiting Greenstead - and thank you for responding.
My need for this feature, however, has passed.
I do have another question or two, but will post as a separate thread.
Thanks again -
HCM F&P - How to set the field as Required based on drop down values
Hi Experts,
I have a requirement to set the Date field as mandatory when a particular value is selected in drop down list. I have already tried with MessageBox though it displays the error message but process moves further i.e. on clicking Check & Send button it throws an error message but still it moves further and i can see only Send button. Ideally it should halt there itself.
Thanks & Regards,
Jitesh TalrejaThanks for your valuable inputs
Chintan
I have already tried this. It only highlight the field with the red border but still allow to move further.
Mukesh
Yes, we can definately control this from the backend but that would be the last option i should execute. Ideally, this is something to be controlled in front end itself
Poornima
By setting the field attrbiute Required will set the field mandatory as a whole irrespective of drop down values or any other UI element.
Regards,
Jitesh Talreja -
CProjects - Set-up field control - Usage of conditions
Hello
In cProjects, in set-up field control it is possible to adjust behavior (display, updatable, mandatory, u2026) field by field.
My questions are:
- Where to find the complete list of conditions available?
- Is any condition is usable everywhere, for example C001 Object is released on a DAG Document (means the object link to this document is released)?
- Is there a condition with a meaning like u201CThe object is in creationu201D (to have for example a phase description not updatable after creation)?
- How to create its own conditions?
Thanks for your help.
Rémy
Here you can find a list of conditions for the main objects.
CTO (Checklist) C001 Object is released
ITO (Checklist Item) C001 Object is released
MTG (Project Participant) C001 Object is released
PPO (Phase) C001 Object is released
TTO (Task) C001 Object is released
MTG (Project Participant) C002 CATS is active
TTO (Task) C002 CATS is active
TTO (Task) C004 Confirmation for task
MTG (Project Participant) C005 Role start and finish are specified
ITO (Checklist Item) C006 Object has a superior phase
TTO (Task) C006 Object has a superior phase
TTO (Task) C007 Phase without approval
TTO (Task) C008 Appr. is in process, granted, rejected
CTO (Checklist) C009 Ind. 'Changeability' to 'Cannot Be Chgd'
ITO (Checklist Item) C009 Ind. 'Changeability' to 'Cannot Be Chgd'
CTO (Checklist) C010 Ind.'Changeability' to 'Partlly Chngble'
ITO (Checklist Item) C010 Ind.'Changeability' to 'Partlly Chngble'
PPO (Phase) C011 Project Type 'Initiative'
PPO (Phase) C015 Constraint: As soon as possible
TTO (Task) C015 Constraint: As soon as possible
ITO (Checklist Item) C016 Constraint: As late as possible
PPO (Phase) C016 Constraint: As late as possible
TTO (Task) C016 Constraint: As late as possible
ITO (Checklist Item) C017 Constraint (Finish Date): None
PPO (Phase) C017 Constraint (Finish Date): None
TTO (Task) C017 Constraint (Finish Date): None
TTO (Task) C018 Task is a summary task
TTO (Task) C019 'Remaining Work Man.'indicator is active
TTO (Task) C020 Object is part of a project version
ITO (Checklist Item) C030 Access to Forecasted Dates
PPO (Phase) C030 Access to Forecasted Dates
TTO (Task) C030 Access to Forecasted Dates
OAG (Object Link) C100 Object has not been specified yet
RAG (Checklist Reference) C200 Checklist reference was created
ATO (Approval) C300 Approval has the status: Created
EAG (Project Element Link to Role) C400 Status: Staffing in Process/Complete
MTG (Project Participant) C500 Status: Staffing in Process/Complete
MTG (Project Participant) C501 Confirmation for project role
BAG (Link to Business Partner) C502 Distribution is active
MTG (Project Participant) C502 Distribution is active
MTG (Project Participant) C503 Status: Staffing in Process
MTG (Project Participant) C504 Cost/revenue rate is initial
TTO (Task) C504 Cost/revenue rate is initial
MTG (Project Participant) C505 Org. Unit (Staff. Manager) is changeable
MTG (Project Participant) C506 Org. Unit (Cand. Manager) is changeable
MTG (Project Participant) C507 Staffing Manager is changeable
MTG (Project Participant) C508 Candidate Manager is changeable
SAO (Individual Approval) C600 Approval allows decision maker change
DAG (Document) C700 cProjects file is checked out
DAG (Document) C701 Plug-in for documents is used
DAG (Document) C702 Document has status 'Not in Process'
DAG (Document) C703 Document is changeable
DAG (Document) C704 Link to document template
DAG (Document) C705 Document in projekt-/checklist template
DAG (Document) C706 cProj. file is checked by current userHi Matthias
I am trying to setup field control to make a bespoke field in a bespoke tab toggle between READ only and Editable.
I have gone through number of posts and the SAP note you mentioned. I have setup the entire configuration required and it is still not working.
What confuses me is that, to setup a field control dynamically, is it all done via configuration?. Is some coding still required in the VIEW methods?. I am setting up a debug breakpoint in the class method that is created for the condition I created, but the program is not stopping there so I think the condition method is not being called.
Please can you give some more details.
Thanks
Raj -
Setting form fields to required not working in Adobe Acrobat XI Pro
This should be a simple matter. However, I'm stuck in a rut with it, and cannot seem to get out.
I have created a form. All I need is for users to be prompted that they have to complete the form field when they try to tab or click out of that particular field where there needs to be information input. I have tried the following "on blur" java script code:
if (!event.value) {
app.alert("This field is required. Please enter a value.");
event.target.setFocus();
What continues to happen is when the user clicks out of that field, the error message comes up asking them to click "okay." The problem is that the error message does not go away after the user clicks it.
What I've learned is that if you right click on a field and click "set as required field," it doesn't work in the way I need it to. In fact, it hasn't been working at all for me.
Does anyone have a simple suggestion? I more than willing to try anything at this point.OK, so the custom calculate script for field B could be something like:
(function () {
// Get field values as strings
var sA = getField("A").valueAsString;
var sC = getField("C").valueAsString;
var sD = getField("D").valueAsString;
// Only perform the calculation if all fields are filled
if (sA && sC && sD) {
var sum = +sC + sD;
event.value = sum;
// Alert the user if the sum is more than A
if (sum > +sA) {
app.alert("Error message goes here");
} else {
// Blank this field if all fields are not filled in
event.value = "";
Instead of (or in addition to) an app.alert popup, you could place this message in a read-only form field, and clear it if there is no error condition. -
SRM 7.0 custom field made required in field control but not working
Dear Gurus,
I have added one custom field in the SC, made it mandatory/required with by setting flag in the field control. But i can save/park/order the SC without entering any value in the field.
However, if i set the same option for a standard field like "shopping cart name", the user cannot go further without entering a value. Although I can handle this with the BAdI, but shouldn't this work?
Regards
AliAlthough I can handle this with the BAdI, but shouldn't this work?
I'd say Yes it should. But it is not working based on my observation. I'd suggest that you create an OSS message and get an official SAP response to this issue. -
I am creating a pdf form that will be used as a calculator, and my javascript knowledge is pretty rudimentary. I can do the simple things, some of what I need to do is over my head.
1. I believe I need to use a combo box to pre populate certain fields. I have 13 variables in the dropdown to choose from, and whatever the client chooses will pre populate three other fields (and each of the 13 variables will populate those three fields differently). I'm not exactly sure how to go about doing this. Is it custom keystroke script or does it require a document script? Also, I'm guessing that whatever script will be a series of if/then statements, correct?
2. Once all the fields have been populated (be it pre population or filled in by the customer), I need to calculate the answer which is not my main problem—I already have the proper calculations in place and they work. The problem is that the answer has a maximum value even if the actual value goes over that max number. So, the actual answer is 14 but the max value can only be 12. How do I get the calculation to replace that actual number (14) with the max number (12)? Is that in the validation tab or should that go elsewhere?
I feel like I know just enough to be dangerous but not terribly effective. Any help is appreciated.
Thanks!1. There is a tutorial on this here:
http://acrobatusers.com/tutorials/change_another_field
2. To set the maximum value to 12, try this as the custom calculation script for the field:
//Custom calculation script
//Get value of text field
var a = this.getField("Text1").value;
//If it is > 12, then make it 12
if (a > 12){
a=12
event.value = a
You need to replace "Text1" with the name of the field in your form. -
How do I set the default value to 0 in a property with "money" as the type?
I have an entity with several properties with the "Money" data type. I also have a Money property with a "computed" value that shows the sum of the other money type properties. However, a total will not display if any of the other
fields are left with a null value. Is there way to make the default value set to "0"? I am using c#. Thank you.Mark, there's a very basic .NET method on every nullable object:
GetValueOrDefault
EDIT: Now I see...please avoid duplicating
questions...
To be clear:
Put GetValueOrDefault on every nullable field used inside your 'TotalDue_Compute' sub
You don't need to define 'TotalDue' as Nullable anymore -
Setting field header width in table control
I have created a table control by using the wizard and i am populating my internal table data in to this.
Here i have small issue.
There are two fields called recoverable, identifiable with char (1).
These two field headers are displayed as R, I on the table control.
Is there any way that i can adjust the field width to accomodate the header.
points will be awarded immediately.
ThanksIn SE51 (Screen Painter), select/click-on the field (not the column header).
Press F2 (to get the Properties window) and set the Visible Length to a larger number. Save and activate the screen. -
Entry in field Funds Center required; check the field control Mg No.FMEF010
Hi,
We have a Z tcode for converting planned order to purchase requisition.
We use Account assignment P - Project and A - Asset.
We have WBS element and fund center linked to it.
For the Z tcode while converting Planned order to purchase requisition we are getting below error
Error: Entry in field Funds Center required; check the field control Msg No.FMEF010
While creating manually purchase requisition with same GL code and WBS element the fund center gets automatically picked.
Can anyone pls let me know in which table we can find the link between WBS element and fund center so that we can code the same in our program. In PRPS table we can find the link between WBS and profit center.
Or is there any user exit that can be used.
Thanks in advance.
Regards,
RadhaHello
If you do a F1 in the value date field it will give you the answer - The value date is used in bank accounts and bank sub-accounts.
As regards the other query check whether the tax code has been already created.
Hope it helps.
Rgds
Maybe you are looking for
-
How to delete the runtime error in st22
Hi all, How to delete the runtime error in ST22. I want to clear the list of short dump in st22 is there any T.code or any table to clear? thanks in advance sundar.c
-
Using a filter to find Masters, only
I have a very large Managed Aperture library and want to filter out all the Masters while I do some cleanup = since if I then delete something it will not be a master and that won't be as much a problem. I thought of using the Adjustments are NOT app
-
Toshiba 8 gb Flash Drive Crashed
I have a Toshiba 8 gb flash drive that just stopped working. The light no longer comes on, and the comuter can't recognize it in the drive. I need to recover the files on the flash drive (all documents). PLEASE HELP!!
-
No Scroll bar with JTextArea on unix machine
hi am using JTextArea with Unix machine... The problem is not enabling scroll bars can anyone help me
-
Problem creating new reports in 11.1.1 - still retains prior reports POV
I have a problem creating new reports in 11.1.1 - it still retains prior reports POV. Example - I create one report - which shows "all locations". I then want to create another report, with a different POV, specific for just one location "North Ameri