I have a form that has 4 sets of radio buttons; all a repetition of the same calculation. The user selects a RB value (1 of 3 named individually for each exclusion group) and inputs a numerical variable value the user has in another numerical field, and then the calculation is scripted in another numerical field. The calculation depends on which radio button is selected.
I would like to script the buttons to "true or false" value. I found this on a past post and would greatly appreciate help in using.
Quote:
//Using a document level function to test a value against "Off" and return the logical result could be used to set the "required" property:
// Document level function
/// My Question? Do you mean in the XML source page after the time stamp? (Too new to post HTML) If this is not where it is located, then where should this appear?
function ButtonRequired(cValue)
{
/*
Function: return result of comparison of passed value to 'Off"
Input: cValue
Return; logical result of comparsion of passed value to "Off"
*/
if (cValue != "Off") {
return false;
} else {
return true;
}
return;
}
// end function
///My Next Question...And then I am trying to make this the script for comparison where GLBase* is named exclusion group, and the subsequent named buttons are PayrollB*, ReceiptsB* and PerunitB* and the result would be GLCost*. When I hit the period after typing GLBase1 in the coding window, the named buttons were in the drop down list. Would the following coding be…
topmostSubform.Page2.GLCost1::calculate - (JavaScript, client)
if (GLbase1.PayrollB1 == true)
(TotalPayroll.rawValue / 1000) * GLRate1.rawValue
else if (GLbase1.ReceiptsB1 == true)
(TotSubAmount.rawValue / 1000) * GLRate1.rawValue
else if (GLbase1.ReceiptsB1 == true)
NoUnits1.rawValue * GLRate1.rawValue
//My Final Question? :) How does the following script effect the above?
//The on blur action could then run the following JavaScript:
/*
on blur action:
set required property on comparison of the field value to "Off"
*/
this.getField(event.target.name).required = ButtonRequired(event.value);
// end on blur action
Much thanks for your help.
https://admin.adobe.acrobat.com/_a200985228/p87746471/
There are other videos and tutorials here on LiveCycle scripting as well.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script