Hi All,
I have created my first form in LiveCycle Designer, but got stuck with the coding. Any help would be greatly appreciated.
In the attached form, based on the Numeric Field value 'Total points' (Calculated from user input),I want two things to happen,
The text field 'level' should show different text according to the points,
and like that...
If total points is less than 10, 'Beginners course' and 'Language' DropDownList should appear.
Is there any way to achieve this? I tried assigning "If" "else" statement, but it is not working. I looked into the previous threads, but couldn't find anything based on numeric value.
Looking for some help,
R
Solved! Go to Solution.
Views
Replies
Total Likes
The attached satisfies your requirements. The following JavaScript on the TextField1 calculate event drives it.
// form1.#subform[0].TextField1::calculate - (JavaScript, client)
if (NumericField1.rawValue != 0) {
if (NumericField1.rawValue < 10) {
DropDownList1.presence = "visible";
DropDownList2.presence = "visible";
this.rawValue = "Beginner";
}
else {
DropDownList1.presence = "hidden";
DropDownList2.presence = "hidden";
if (NumericField1.rawValue < 15) {
this.rawValue = "Intermediate";
}
else {
this.rawValue = "";
}
}
}
Steve
Views
Replies
Total Likes
The attached satisfies your requirements. The following JavaScript on the TextField1 calculate event drives it.
// form1.#subform[0].TextField1::calculate - (JavaScript, client)
if (NumericField1.rawValue != 0) {
if (NumericField1.rawValue < 10) {
DropDownList1.presence = "visible";
DropDownList2.presence = "visible";
this.rawValue = "Beginner";
}
else {
DropDownList1.presence = "hidden";
DropDownList2.presence = "hidden";
if (NumericField1.rawValue < 15) {
this.rawValue = "Intermediate";
}
else {
this.rawValue = "";
}
}
}
Steve
Views
Replies
Total Likes
Thank you so much Steve. It worked.
I am sorry. This might be a dumb question to ask. In the code, could you please explain the first part, "(NumericField1.rawValue != 0)".
Since, I assigned the rest of the code, which obviously didn't work. I am new to coding.
Are there any coding tutorial available for LiveCycle Designer for newbies like me???
Thanks a lot
R
Views
Replies
Total Likes
No dumb questions. The expression 'NumericField1.rawValue != 0' is used to test the value of NumericField1, in this case 0 (zero), which is the default value of a numeric field. I want to apply logic if the field is not 0, only.
Steve
Thank you Steve
Views
Replies
Total Likes
Not really specific to LiveCycle but there are lots of javascript tutorials around. They're all pretty much geared towards the web but you can still learn the basics.
Check out http://www.w3schools.com/
Take a look at http://my.safaribooksonline.com/9780321509871
Views
Replies
Total Likes
Oh yeah, and that book - it's great!
Views
Replies
Total Likes
Thank you Jono and Steve.
Views
Replies
Total Likes
Hi Steve,
Sorry for bugging yor further. Another question. I want the changes to happen only after the rating points reaches '10' .
Is there any way to assign the condition to our code?
Thank you
R
Views
Replies
Total Likes
Got it...
I have added another 'if" "else" statement to the code and it works as I wanted...
Thank you Steve.
R
Views
Replies
Total Likes
Views
Likes
Replies