Mutiply textfield by value when checkbox is check
Hello all,
I have a fillable PDF Form, built in Adobe Acrobat Pro X, that I am creating as a repair form with charges included in it.
I know how to have a value filled in a given text field when a checkbox is checked.
My question is this. Say I have a textfield labeled as "labor_hrs" that is set to a number format. What I want to do is to have this box multiplied by a given value of 45.00 populated to the "labor_chrg" text field. I can get this feature to work on its own.
What I want to do is only have the value populated to the "labor_chrg" when the checkbox labeled "billable" is checked.
Any help would be appreciated.
A quick way is to set the export value of the "billable" check box to 1.
You can then use the simplified field notation script of:
(labor_hrs * 45) * billable
A custom JavaScript calculation:
function GetField(cName) {
// return field object with error checking;
var oField = this.getField(cName);
if(oField == null) app.alert("Error accessing field " + cName, 0,1);
return oField;
} // end GetField function;
event.value = (isNaN(GetField("billable").value) == false) * GetField("labor_hrs").value * 45;
If you add a hidden field for labor rate called "labor_rate", then you can use the "Field is the product of the following fields:" and select the "billable", "labor_hrs", and "labor_rate" fields.
Similar Messages
-
How to linking a textfield to another when checkbox is checked.
HI All
Can Anybody please help me;)
I want to do the following: I have to textfileds in a pdf form. Next to the second textfiled is a checkbox. I want to have the second textfiled to be linked to the first one only when the checkbox is checked.
So when the checkbox is checked, the second textfiled should have the same value as the first textfield. Whe the checkbox is not checked The second textfiled can be overwritten and has its own value.
This is my try:
var g = this.getField("checkbox1");
if(g.isBoxChecked(1))
var f = this.getField("Text1");
event.value = f.value;
Now the if statement doesn´t work. But when i just have this:
var f = this.getField("Text1");
event.value = f.value;
It works fine, and both textfiled s have the same value.
Can anybody please help me?;)
I am searching the whole net now for 2 days and haven´t found anything usefull. I also didn´t find anything in the adobe documentations and sample pdf files:(
Thanks for any hint;)
cheers dietmarCorey,
Use a combo box with the part number and a switch statement (on blur, and commit immediately) linked to several text fields for the description. Something like this:
var combo1 = this.getField("Combo Box5").value;
var endDefault;
var a = this.getField("Text1")
var b = this.getField("Text2")
var c = this.getField("Text3")
switch (combo1){
case "Select an address":
getField("Text1").value = "",
getField("Text2").value = "",
getField("Text3").value = "";
break;
case "Part #1":
getField("Text1").value = "Part #1 Description",
getField("Text2").value = "Line break 1 description",
getField("Text3").value = "Line break 2 description";
break;
case "Part #2":
getField("Text1").value = "Part #2 Description",
getField("Text2").value = "Line break 1 description",
getField("Text3").value = "Line break 2 description";
break;
case "Part #3":
getField("Text1").value = "Part #3 Description",
getField("Text2").value = "Line break 1 description",
getField("Text3").value = "Line break 2 description";
break;
default:
endDefault = false;
if (endDefault = false)
app.alert("Please select from the drop-down menu",3); -
Make field editable when checkbox is checked, otherwise given read-only value
I'm attempting to make a fillable PDF form, from and existing document, using Acrobat Pro that does the following:
Purpose of form is to provide customer a way to agree to purchase a custom artwork.
The artwork has a base price, ArtworkPrice. (The ArtworkPrice field is editable)
The customer can choose to include a picture frame. (AddFrame checkbox 'Yes'.)
Choosing 'Yes' to add a frame adds an amount. (The FramePrice field is editable only if AddFrame checkbox is checked)
Otherwise, Leaving AddFrame unchecked fills the FramePrice field with a value of 0.00.
The TotalPrice is calculated as the sum of the ArtworkPrice and the FramePrice fields. (The TotalPrice field is read-only)
So...this part of the form looks essentially of like this:
AddFrame? [ ] Yes
ArtworkPrice $__________ + FramePrice $__________ = TotalPrice $__________
The FramePrice field must be 0.00 (and not editable) at all times unless the AddFrame checkbox is selected.
How can I do this?Add this code to the MouseUp event of AddFrame:
if (this.getField("AddFrame").value=="Off") {
this.getField("FramePrice").value = 0;
this.getField("FramePrice").readonly = true;
} else {
this.getField("FramePrice").value = "";
this.getField("FramePrice").readonly = false; -
What to write query to get know if a checkbox is checked
hello,
I have created a checkbox with name Entertainment containing static values Movie,Play,music.
Now i have to write query to check which value of checkbox is checked ,means play or movie or music.
According to that i have to mail a particular link to a user.
I have seen in how to (checkbox help) but not getting it.
please anyone can help me out.HI marc,
I think so u are not able to get my problem,i will explain it in detail.
I have a table USERINFO which has variables of type varchar2,these variable are used as a checkbox on page name 'ENTER INFORMATION',these checkbox have some static values,every time a user checks checkbox values it get stored in database,suppose there is a checkbox name sport with static values cricket,football,now if any user select cricket this value get stored in database with username ,mailid.
Now i have a page on this i want to give user facility to enter name of checkbox to create and its corresponding static values,and these checkbox should get display on page 'ENTER INFORMATION'and a variable of type varchar2() with checkbox name should get create in tableUSERINFO .
now can u suggest me how can i achieve this. -
Insert statement in when-checkbox-checked trigger doesn't work
in a when-checkbox-checked trigger, I wrote the follwing code :
IF :sunday = 'Y' THEN
msg_alert('Y','I',false);
pkg_var.v_day_count := pkg_var.v_day_count + 1;
msg_alert('1','I',false);
:schtm_skmk.day_id := '1';
msg_alert('2 ',I',false);
INSERT INTO schtm
(ROUTE_ID, DAY_ID, FLIGHT_ID)
VALUES
(:schmf.ROUTE_ID, :schtm_skmk.day_id, 1);
COMMIT;
msg_alert('end insert schtm','I',false);
END IF;
if the checkbox is checked, I assigned value '1' to day_id. Then, I want to insert a row into table SCHTM. But, the insert statement fail. The msg_alert '2' pop up. The msg_alert 'end insert schtm' does not pop up, meaning the insert statement fail. It also fail after I replace the insert statement with the exact value of the item. But if I execute this statement in SQL plus, it insert a row into the database.
What is strange here is it did work before, I successfully insert 2 rows into database. But when I test it again just a while later, it never work anymore.
Please help.
Thanks,
Shu WenIt seems that you have missed ELSE. By the way there is only one INSERT ...
-
In Acrobat, I wrote a script to turn fields gray if a checkbox was checked. How can I get it to reset to white (or clear) when the reset form button is clicked?
Thank you so much for your reply . . . but . . . I should have shared my original script with you -- it was a little more complicated than I led you to believer. I was triggering a group of text fields to become disabled as well as gray. Below is the original script so that when the checkbox is checked, it causes several "Co" fields to be disabled and gray.
// Mouse Up script for check box
// If checked, certain fields should be disabled
var f_prefix = "Co";
// Get a reference to all of the "Co" fields
var f = getField(f_prefix);
// Reset the Co fields
resetForm([f_prefix]);
if (event.target.value === "Off") {
// Enable the Co fields
f.readonly = false;
f.fillColor = color.transparent;
} else {
// Disable the Co fields
f.readonly = true;
f.fillColor = color.gray;
To recap -- my goal is to get those gray fields to revert to transparent if the form is reset. I'm willing to create my own custom "Reset Form" button but I'm not sure I understand how that would look. Wouldn't it be quite lengthy? I think I'm having a brain freeze -- can't figure it out! -
How to record the time when a checkbox was checked?
I would like to insert the value of NOW() at the moment when a checkbox is changed from unchecked to checked.
Having a programming background but now spreadsheet background, I can't find out how to do this seemingly easy thing.Hello
It may appears as a
• simple task:
if the checkbox is B2,
in C2 enter =IF(B2=TRUE,NOW(),"")
The time will be displayed when you will check the box
• not so simple
the time displayed in c2 is a "living" one.
It will change each time when the sheet will recalculate. So the value will not be accurate.
Here is a script which will give an accurate result:
Enregistrer le script en tant qu'Application ou Progiciel : checkandtime.app
déplacer l'application créée dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Copier le contenu de la cellule "pseudo case à cocher" dans le presse-papiers.
Sortez de la cellule puis cliquez sur celle-ci
menu Scripts > checkandtime
Si vous travaillez avec Mac OS X 10.4.x, le script collera " " ou "X"
Si vous travaillez avec Mac OS X 10.5.x, le script collera un caractère Unicode coché/pas coché
S'il colle coché il colle également la date/heure dans la cellule adjacente
+++++++
Save the script as an Application or an Application Bundle: checkandtime.app
Move the newly created application into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Copy the contents of the "fake checkbox" cell in the clipboard
Exit from the cell then click once in it.
menu Scripts > checkandtime
If you work with MacOS X 10.4.x the script will paste " " or "X"
If you work with MacOS X 10.5.x the script will paste an Unicode character: checked or unchecked
If it paste checked, it paste also the current date_time in the adjacent cell.
Yvan KOENIG le 27 mars 2008
--(SCRIPT checkandtime.app]
on run
set theApp to "Numbers"
try
set txtDatas to the clipboard as Unicode text
on error (*
The clipboard was empty *)
return
end try
log txtDatas
if txtDatas contains tab then return
set txtDatas to my applyMask(txtDatas, theApp)
log txtDatas
set the clipboard to txtDatas
my pasteIn(theApp)
end run
--=============
on pasteIn(the_App)
tell application the_App to activate
tell application "System Events" to tell (first process whose title is the_App) to keystroke "v" using {command down}
end pasteIn
--=============
on applyMask(t, the_App)
try
set v to (system attribute "sys1")
if (v's class is integer) then
set v to (v as string) & "." & (system attribute "sys2") & "." & (system attribute "sys3")
else
error
end if
on error
set v to (system attribute "sysv")
set v to ((v div 4096 * 10 + v mod 4096 div 256) as string) & "." & v mod 256 div 16 & "." & v mod 16
end try
if v < "
set faux to " "
else
set vrai to character id 9745
set faux to character id 9723
end if
if t is vrai then
return faux & tab & " "
else
return vrai & tab & (current date) as text
end if
end applyMask
--=============
--[/SCRIPT]
Yvan KOENIG (from FRANCE jeudi 27 mars 2008 14:32:26) -
Change the background of a text field when a checkbox is checked?
Hi,
I'm new to Adobe JS, having done some browser scripting previously.
I'm making a form in which I would like to change the background of a text field to bright yellow (RGB code 220,220,0) when a corresponding checkbox is checked?
I have a checkbox named chkCD56, with an option value set to 1.
I have a text field named CD56 with a transparent background.
Can someone help me with the JS code?
Thanks.Hi
To make your number filed in Red :
Right click on the field and go in format field click on Font tab and go in Color formula editor and give the following formula :
If Sum(fieldValue} < 0 Then CrRed else CrNoColor
Now go in Style formula editor and give the following :
if sum() < 0 then Critalic
This will make your field red and italic when it is less than 0
Thanks,
Sastry -
How can i set a form to read only when a checkbox it checked?
How can i set a form to read only when a checkbox it checked?
Hi,
If you search the forums for Paul's example LockAllFields. This contains a function in a script object that you can call from the click event of the checkbox.
Re: Saving Fillable Form as non-fillable PDF
Good luck,
Niall
Assure Dynamics -
How to Get checkbox value when List value changed in classic report
hi ,
i worked with apex 4.2 and i create normal classic report with one checkbox column and one column change it to select list(named loved) now i want when user change list
take value of checkbox item and show it in message .
SQL for report
SELECT
'<INPUT TYPE="checkbox" NAME="f01" VALUE="'
||SEQ
||'">' SEQ,
ID,
DEPT_NO,
EMP_NAME} i change the column attributes of Dept_NO to Display as Select list of department name (named lov).
now i want when user change name of department the value of SEQ SHOW IN ALERT MESSAGE
i create JavaScript on the page
function test(pThis) {
var f01_value = $('select[name="f01"]').value;
alert('#SEQ : '+ f01_value);
</script>
I call this javascript function when list change but the value undefined..
My Question :
How can get this value Or any value of item in reports
regards
AhmedHi Ahmed,
>
i worked with apex 4.2 and i create normal classic report with one checkbox column and one column change it to select list(named loved) now i want when user change list
take value of checkbox item and show it in message .
SQL for report
SELECT
'<INPUT TYPE="checkbox" NAME="f01" VALUE="'
||SEQ
||'">' SEQ,
ID,
DEPT_NO,
EMP_NAME} i change the column attributes of Dept_NO to Display as Select list of department name (named lov).
>
You should not create checkboxes like this. Either use the APEX_ITEM.CHECKBOX2 API or change the Column Type to Simple Checkbox.
>
now i want when user change name of department the value of SEQ SHOW IN ALERT MESSAGE
i create JavaScript on the page
function test(pThis) {
var f01_value = $('select[name="f01"]').value;
alert('#SEQ : '+ f01_value);
</script>
>
name="f01" returns an array, what you need is single element value.
Try
<script type="text/javascript>
function test(pThis) {
var f01_value = $v(pThis);
alert('#SEQ : '+ f01_value);
</script>
{code}
{quote}
I call this javascript function when list change but the value undefined..
My Question :
How can get this value Or any value of item in reports
{quote}
Depends in how you are invoking/triggering the change event. Are you using DA or have you written an "onchange" event on the element?
Cheers, -
"trigger" when report checkbox is checked
Hello,
I have a report with a column defined as a checkbox . Now I want to trigger/process immediately when a checkbox is checked. eg if 2 checkboxes are checked an item has to dissapear.
CAn anybody help me please?
ErwinYou can probably do this easier using forms personalization - pl see ML Doc 279034.1 for details
HTH
Srini -
Getting values from a multi check box
I have a multi record block with on text item and check box... I ned to get the value when i click the checkbox to fetch the data from teh sql query..
For eg;
I have a multi record block with the values as A,B,C,D,E and if i check the checkbox for teh dept A,C,D then I should ge the return value as ('A','C','D') to fetch the data from the query
Requesting your help..Thanks in AdvanceCheckbox properties:
"Value when Checked" - 1
"Value when Unchecked" - 0
Create variable str varchar2(2000) in the package val
Create summerized item (sum of checkboxes)
When-Checkbox-Changed Trigger
if <checkbox> = 1
then
val.str := val.str||''''||<text_value||''',';
else
val.str := replace(val.str, ''''||<text_value||''',', NULL);
end if;
Pre-qwery trigger
if <sum of checkboxes> = 0
then
-- No selection => no qwery
raise form_trigger_failure;
elsif <sum of checkboxes> = 1
then
set_block_property(..., default_where, 'where ... = '||rtrim(val.str, ','));
else
set_block_property(..., default_where, 'where ... IN ('||rtrim(val.str, ',')||')');
end if; -
How to disable one check box when another is checked
Hi, I'm a first time user.
i am trying to make text fields appar and dissapaer when check boxes are ticked. but only alow one check box to be active at one time.
I am making a simple form in Acrobat pro 9,
I have two check boxes Checkbox1 & Checkbox2.
I have two text fields Textfield1 & Textfield2
i have added actions to checkbox1 & checkbox2 to 'hide or show' the text fields.
Action --> on focus (checkbox1) show/hide field (textfield1) is hide
Action --> on focus (checkbox1) show/hide field (textfield2) is show
oposite
Action --> on focus (checkbox2) show/hide field (textfield2) is hide
Action --> on focus (checkbox2) show/hide field (textfield1) is show
problem 1 - how to disable checkbox1 when checkbox 2 is ticked.
or disable checkbox2 when checkbox1 is ticked.
my other problem is that this action has the same effect for ticking or unticking the checkbox.
thanks in advance to anyone who can help.
can you please write your answer in simple terms. Basically this is the first time i have used acrobat pro so please dont assume any knowledge at all. thansk very much .First, I would experiment with just check boxes and learn their properties and how they can interact.
Have you tried using the same name for 2 check boxes and assign a different "export value" to each check box.
Have you looked at the values a check box or boxes have when checked or un-checked?
Have you looked at how the various actions for a field work? -
Defaulting checkbox with check in SC and holding user changes later
Hello All,
I have created a custom field - checkbox in SC basic data. My requirement is to default the checkbox ticked and when the user trys to uncheck it, the user change should be captured.
I have defaulted the checkbox in BBP_CUF_BADI_2 badi. But the checkbox is always getting checked even if the user unchecks it. Is there any way to default the checkbox checked and also hold the user input.
Any suggestions on how to do this?
Thanks and regards,
AshaHi Latha,
Default the field as checked in begining using using CUF BADI , capture the value of check box in CHANGE BADI and SET the value using SET PARAMETER in CHANGE BADI and fetch the current value of checkbox using GET PARAMETER in CUF BADI to keep the field checked or unchecked.
Regards,
Anubhav -
How to check whether a checkbox is checked
This code:
if (checkBoxCSharpShown.IsChecked)
checkBoxCSharpShown.IsChecked = false;
elicits:
"Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?)"
How can I check whether the checkBox is checked?
Delphi ancient/C# newbieSo why is this so complicated? Why doesn't a check box have a true/false value? The answer is that a checkbox can (optionally and not by default) be a three-state control.
When ThreeState is true, the checkbox has three states:
Checked
Not Checked
Indeterminate
They correspond to these tests:
bool checked = IsChecked.HasValue && IsChecked.Value == true
bool unchecked = IsChecked.HasValue && IsChecked.Value == false
bool indeterminate = IsChecked.HasValue == false
One of the ways a three-state checkbox is used is in a property dialog. If the user selects multiple items (all having some boolean property called 'Active'--for instance), what should the proprety dialog show for that selection if the value of Active is different among the selected items? Should it show True? That wouldn't work, they are not all True, same for False. So instead the property dialog would show Indeterminate, indicating that the collection of Active values is neither True, nor False.
Now having said all of that I'll refer you to:
CheckBox.Checked
This is true or false. If the ThreeState property is True, Checked returns True for True or Indeterminate.
Maybe you are looking for
-
I would also like to use the teststand basic gui window wich asks for the serial number and then runs the tests without seeing the teststand environment in the background ie I would like the test to look simple to the user without building a new gui.
-
I have a mac book 10.4.11. how do i upgrade to mountain lion?
Do i have to download operating systems in oder or can i just download mountain lion?
-
Macbook pro (late 2008) running Mountain Lion... crash!?
Hey, my macbook pro crashes from time to time... i think it is when i do graphic intense stuff like rendering finalcut or playing c&c... playing c&c for example it restarts every time after several minutes of playing with the following report: can so
-
Hi SAP Experts, May i know the field and Table name of Overall blkd status field in status tab page of sales order header level and Reason of blocking(ex:Dynamic check,oldest item) field and table name.Structure are there in
-
Why doesn't masking with gradient layer work when regular gradient does?
If I make a regular gradient over a layer, and make it's opacity 0, and have it on 'shallow knockout', it will knockout the layer below along the 'lines' of the gradient. However, when I make a gradient layer to do the same, and set opacity down to z