on 05-05-2008 6:20 PM
I want to add some non trivial functions to my forms, so they look fancier.
What i want to do is: -In a drop down list there are to possible choices.
-If I choose A, I hide some fields on the form
If I choose B i hide some other fields, and make some other reappear.
I guess scripts can do this, but I don't know how, can you give me an example? How do I check which option is chosen, to start with?
Thanks,
Peter
Try to use FormCalc instead.
var value = xfa.event.newText
if ( value eq "TERMINATION OF EMPLOYMENT" ) then
NAME_OF_NOU.presence = "invisible"
ADDITIONAL_COMMENT.rawValue= "Termination of Job"
NAM_OF_STH.presence="invisible"
else
NAME_OF_NOU.presence = "visible"
ADDITIONAL_COMMENT.rawValue= " "
NAM_OF_STH.presence="visible"
endif
reward point if it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My code was:
var value = xfa.event.newText;
if (value == "TERMINATION OF EMPLOYMENt" ) {
NAME_OF_NOU.presence = "invisible";
ADDITIONAL_COMMENT.rawValue= "Termination of Job";
NAM_OF_STH.presence="invisible"; }
else
{
NAME_OF_NOU.presence = "visible";
ADDITIONAL_COMMENT.rawValue= " ";
NAM_OF_STH.presence="visible";
}
The error message: Syntax error near token' { ' on line 3 column 44
I colored the place of error red. But I don't understand why it's not good..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter,
The Preview should work.
I think there may be an issue with the following statement: "var value = xfa.event.newText;"
So, adjust your code as following:
var value = TextField1.rawValue;
if (value == 'correct') {
xfa.host.messageBox("YES");
}
else
{
xfa.host.messageBox("NO");
}
hope this helps.
harman
Place the following code on the "onChange" event for the DropDown list
//Get the selected value of the dropdown list
var value = xfa.event.newText;
if (value == 'A')
{
Button1.presence = "invisible"
Button2.presence = "visible";
}
else
{
Button2.presence = "invisible"
Button1.presence = "visible";
}
Code may have some syntax errors, but you get the idea
Hope this helps,
Harman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.