Actionscript & changing form field values
I am building a form using flash forms. I have a particular
field that by default the value is 0.00. I want to make an onchange
actionscript that will dynamically change the form field value to
0.00 if the end user deletes the value out of the field and leaves
it blank.
Please be gentle...I know my actionscript'ing is poor (and
probably looks a wee bit more like JS than AS) LOL
<cfsavecontent variable="zero_myfield>
if (myfield.text == '') {
myform.myfield.text == "0.00";
</cfsavecontent>
<cfinput type="text" name="myfield"
onchange="zero_myfield">
I know you can manipulate the value of a form field easily
with javascript, but how to do the same thing with actionscript?
Any pointers would be appreciated!
Thanks!!
ROFL, I figured as much...like I said, my AS is *very*
rudimentary right now heheh
I picked up an AS book yesterday evening to hopefully help me
out some, I know not all AS is available to use in ColdFusion flash
forms, but it will give me a good reference I hope.
I'll try my hand at the listener and see what I can come up
with. Thanks for the pointer!! :)
Similar Messages
-
I have the PDF form with several fields. I want to set the value of one field depending on selection made by the user in other field. I am trying to use if statement but it does not work for me. I have copied below the script I am trying to use.
form1.#pageSet[0].Page1.Table.Table3[0].Row1.Cell1::change - (JavaScript, client)
if (oField.rawValue == "Service Alert")
this.resolveNode("Cell4").rawValue = "A";
else if (oField.rawValue == "Service Bulletin")
this.resolveNode("Cell4").rawValue = "B";
When user selects Service Alert in Cell1 I want the value of Cell4 to be set to A and if Service Bulletin is selected I want the value of Cell4 to be set to B.
Can someone help me with the script. I have done a bit of searching and tested verious syntax but nothing did work. I hope someone will help me to have it working.
Regards,
TonyThank you very much for your help, but it did not work for me. I have decided to reply and to send you the form. Could you please have a look on what I have done and try to fix it. I want to add action to Cell1 to modify Cell4 in row 1 of the form, top on the blue background.
Regards,
Tony Pluta
Engineering Technical Coordinator / Graphics Designer, Engineering
Rail
Description: C:\Users\tony.pluta\AppData\Roaming\Microsoft\Signatures\UGLLimited.gif
16 Broadmeadow Rd | Broadmeadow NSW 2292 | Australia
Direct: +61 2 9492 1277 | Mobile: +61 403 399 167
Fax: +61 2 9462 1383
Email: [email protected]
Web: www.ugllimited.com<http://www.ugllimited.com/>
Please consider our environment footprint before printing this e-mail
From: kvdvijaykumar [email protected]
Sent: Wednesday, 29 May 2013 4:14 PM
To: Tony Pluta
Subject: modify form field value
Re: modify form field value
created by kvdvijaykumar<http://forums.adobe.com/people/kvdvijaykumar> in LiveCycle Designer - View the full discussion<http://forums.adobe.com/message/5360639#5360639 -
Forms personalyzation, passing Form field values to SRS concurrent request.
Hi,
Iam calling an SRS from forms personlization. Can any body tell me how to pass the Form field values as parameters to the Reports. (Example when they call this Concurrent request from Transactions screen, The invoice number should be defaulted in the report parameter).
Regards,,
Anil.Hi,
You can use FND_REQUEST.SUBMIT_REQUEST to submit a concurrent progrm with parameters given.
For example, get the invoice number into v_invoice_no and call a function included code bellow.
FND_REQUEST.SUBMIT_REQUEST(
<app_short_name>,
<concurrent_short_name>,
to_char(SYSDATE,'DD-MON-YYYY HH24:MI'),
FALSE,
v_invoice_no,chr(0),'','','','','','','','',
'','','','','','','','','','');-- 100 ARGUMENTS FROM THE BEGINNING
Where chr(0) must be the last argument. -
Processing on change of field values in internal table
I have a internal table eg
id type keyword
1 1 report
1 1 program
n02 4 event
n02 5 loop
n03 6 call
n03 6 do
No when even id changes from 1 to n02...i want to write " id id 1' similarily wenever id changes from n02 to n03 then id is " id is n02" and so on
How can do some sequential processing on change of field values in internal tablehi,
This code will resolve your purpose.
DATA:
BEGIN OF t_tab OCCURS 0,
int TYPE c,
str TYPE char10,
var TYPE char3,
END OF t_tab.
t_tab-var = '1'.
t_tab-int = 1.
t_tab-str = 'report'.
APPEND t_tab.
t_tab-var = '1'.
t_tab-int = 1.
t_tab-str = 'program'.
APPEND t_tab.
t_tab-var = 'n02'.
t_tab-int = 4.
t_tab-str = 'event'.
APPEND t_tab.
t_tab-var = 'n02'.
t_tab-int = 5.
t_tab-str = 'loop'.
APPEND t_tab.
t_tab-var = 'n03'.
t_tab-int = 6.
t_tab-str = 'call'.
APPEND t_tab.
t_tab-var = 'n03'.
t_tab-int = 6.
t_tab-str = 'do'.
APPEND t_tab.
LOOP AT t_tab.
ON CHANGE OF t_tab-var.
WRITE:
/ 'id' ,t_tab-var, t_tab-int.
ENDON.
ENDLOOP.
Thanks and regards
Sharath -
How to pass the FORM Fields value by Form Personalization
Hi ALL,
I want to pass form filds values in to procedure. I am calling this procedure through form personalization of that form..... But it's not accepting any form field's value there... when i am passing hardcoded vales procedure is executing fine...
can any one suggest what to do???
i tried with these syntax
TEST_EMP_FP(:ADDR.ADDRESS_ID,'ABC')
TEST_EMP_FP(${item.ADDR.ADDRESS_ID.value},'ABC')
Regards
RaviHi,
Iam calling an SRS from forms personlization. Can any body tell me how to pass the Form field values as parameters to the Reports. (Example when they call this Concurrent request from Transact5ions screen, The invoice number should be defaulted in the report parameter).
Regards,,
Anil. -
Referencing form field values in javascript
I am attempting to call a report from a button on a form in Portal. I have been successful in calling a report from a OnClick JavaScript event handler, but I also need to send a parameter to the report based on the value in a field on the form.
I have been unable to find any information on how to do this. Does someone know how to do this? Thanks.
Bruce Cable
Kids123.comPerhaps this technote below may be of help:
Addressing field values in forms
For forms all of the form field values are kept in the "session storage", which is an internal
data structure object
and has some methods to access the data
to access them you must have following information:
1. Block name
- DEFAULT for forms on tables
- MASTER_BLOCK for the master section of MD form
- DETAIL_BLOCK for the detail section of MD form
2. Attribute name (is the column name plus 'A_' prefix)
3. Column datatype (NUMBER, VARCHAR2, DATE)
Example:
declare
my_empno number;
begin
my_empno := p_session.get_value_as_NUMBER(
p_block_name => 'DEFAULT',
p_attribute_name => 'A_EMPNO');
end;
In case of MD form, there are 2 blocks - MASTER_BLOCK for master section of the form
and DETAIL_BLOCK for the detail section. Since there is more that 1 record in detail section
you must specify a row index for the detail row
Example:
declare
my_empno number;
begin
my_empno := p_session.get_value_as_NUMBER(
p_block_name => 'DETAIL_BLOCK',
p_attribute_name => 'A_EMPNO'
p_index => 5);
end;
Writing custom buttons code
Every event handler has p_session argument, for any event handler it is a reference to the
session storage object, by calling
appropriate methods you can get and set values of the fields in the form.
Attribute names are create by adding 'A_' to your table's column names, so DEPTNO becomes
A_DEPTNO
Note, if you add a button to detail section of the form for each detail row then you'll have to
examine p_instance value which will be set to a number indicating for which row button has been
pressed. (1 for the first detail record, 2, 3, etc.)
Example:
bold - generated part
italic - custom code
procedure WWV_DETAIL_GENSYS_99
p_block_name in varchar2,
p_object_name in varchar2,
p_instance in integer,
p_event_type in varchar2,
p_user_args in varchar2,
p_session in out DNONKIN.wwa_api_module_session
is
begin
declare
my_action varchar2(4000);
var1 integer;
var2 varchar2(4000);
begin
my_action := p_session.get_value_as_varchar2(
p_block_name => p_block_name,
p_attribute_name => '_DETAIL_ACTION',
p_index => p_instance
if my_action = 'DELETE' then
var1:=p_session.get_value_as_NUMBER(
p_block_name => p_block_name,
p_attribute_name => 'A_EMPNO',
p_index => p_instance
var2:=p_session.get_value_as_VARCHAR2(
p_block_name => p_block_name,
p_attribute_name => 'A_ENAME',
p_index => p_instance
--- Add a record to my log table
insert into my_log values (var1,var2);
end if;
exception when others then
my_error_handler_if_any;
raise;
end;
end WWV_DETAIL_GENSYS_99;
null -
Hi,
How to access a Form Field value [Inventory Transfer] in a query:
Tried all these combination:
$[http://940.18.1], $[http://$940.18.1], $[OWTR.Filler]
What is the right format to access the field value & Is there a way to check [debug] what the values are ?
Am using: SAP B1 2005B SP:00 PL:34
Regards.First, Enable System information from the View Menu. This will enable you to see the table name and the field name when you click on the field.
Once you get this info, you can access it by $[[TableName.FieldName]]
Remote the http:// that you see above
$ [ ] are all required.
Suda -
Can we change key field values in table maintenance
Hi,
I have created Z-table and table maintenance for the same...
In table maintenance..Can we change key field values??
Is there any posibility????
Rayuduyou can do it in this way.
open sm30->tablname->edit
snow select the row(s)->copy->change the keyfield values-back->save.
no in that sm30, select records with old primary key and delete->save.
so you got all field similar for those record under modification, only the key field changed. -
Change hidden form field value
hi everyone...i'm hoping someone can help me figure out how
to change the value of a hidden field in a form. i have a page
setup where users pay a website fee. since the fee is always the
same, i have the amount setup in a hidden field in my form. my
question is, i'd like to use promo codes. so i'll add a box in my
form that says "enter promo code." then there's a link in the form
that says "apply promo code." i'm thinking that link needs to
refresh my page and take the value entered by the user in the promo
code form field and place it in the url. that way i can write a
cfif statement to change the value of the hidden field. the problem
is, i can't figure out how to "refresh" the page and take the value
out of the form field and place it in the url. hope this makes
sense. maybe someone can offer a better way to do this? i'd truly
appreciate any help anyone can offer. thanks!You would change the amount on the processing page with
ColdFusion (after the form is submitted), but prior to the CFHTTP
call. You really should familiarize yourself with CFHTTP (check
online documentation). It sounds like it is exactly what you need.
The format of your application would be something like:
promocode.cfm:
====================
<form name="someform" method="post"
action="process.cfm">
<input type="text" name="name">
<input type="text" name="address">
<input type="text" name="promocode">
<input type="hidden" name="order_price"
value="#OrderValue#>
</form>
process.cfm
======================
<!--- Apply promo code --->
<cfif form.promocode eq "Promo1">
<cfset form.order_price = .75 * form.order_price>
</cfif>
<cfset sales_tax = .1 * form.order_price>
<!--- Send data to processor gateway --->
<cfhttp url="https://www.myProcessor.com/gateway/"
method="POST">
<cfhttpparam type="FORMFIELD" name="price"
value="#form.order_price#">
<cfhttpparam type="FORMFIELD" name="tax"
value="#sales_tax #">
<cfhttpparam type="FORMFIELD" name="cc_number"
value="#cc_num #">
</cfhttp>
<!--- Check response --->
<cfif FindNoCase("Success Text", CFHTTP.fileContent)>
Good Response
<cfelse>
Bad Response
</cfif> -
How can I add form field value to the file name in save as dialog box
I do not want the form to be saved automatically, just want the form to auto populate the "file name" only.
A little background on the forms I want to use: My company has 70 retail outlets, I'll use one of our pdf forms called an "Incident Report" as an example. I would like for a store manager to be able to complete the form, then email the form to the main office (I already have javascript to add field values and form name to the email subject line), once the main office receives it, I want for them to be able to file the pdf electronically on our server. We have mutliple forms that we use so I do not want any of the forms to automatically save anywhere, (at this time anyway) I just want the office personnel to be able to click "save as" (or whatever they will need to click) and the form automatically add certain field values from the pdf they have received, of which will be different each time the form is sent to the office (Date, store #, employee name etc.) in addition to the name of the form in the "File name" of the "Save As" dialog box. The main office employees will decide into which server file the pdf should be saved.
I'm using Acrobat 8 professional, the stores and office personnel use Adobe reader.
One little note: We currently print and file a lot of paper on a daily bases, as soon as I can get this to work, we are going green.
Me and a lot of trees in this will really apprecitate any help you can give with this! :-)You might want to take a look at the document "Developing Acrobat Applications Using JavaScript" (js_developer_guide.pdf) which is part of the Adobe Acrobat SDK, which can be downloaded here. Read the "Privileged versus non-privileged context" (p. 45ff.). You will find an example for "Executing privileged methods in a non-privileged context". Should be almost exactly what you are looking for.
Small Outline: For security reasons ("the user always has to know what's going on") you are not allowed to use the "Doc.saveAs"-method without the user permission (--> in a non-privileged context). In order to reach the goal of a privileged context you can use a trusted function. You do this by creating a JavaScript file (*.js) in either the Application-JavaScript-Folder (default location on Windows systems: "%ProgramFiles%\Adobe\Acrobat 10.0\Acrobat\Javascripts") or the User-JavaScript-Folder (default location on Windows systems: "%AppData%\Adobe\Acrobat\10.0\JavaScripts"). Add the following content to the new file:
myTrustedBrowseForDoc = app.trustedFunction( function ( oArgs ) {
app.beginPriv();
var myTrustedRetn = app.browseForDoc( oArgs );
app.endPriv();
return myTrustedRetn;
myTrustedSaveAs = app.trustedFunction( function ( doc, oArgs ) {
app.beginPriv();
var myTrustedRetn = doc.saveAs( oArgs );
app.endPriv();
return myTrustedRetn;
The developer guide actually wants you to add this content to the existing "config.js" file. I recommend creating a new file, since its easier to deploy in a network. Either way, every client/user who needs to be able to save documents this way, needs this JavaScript Code in his Application/User-JavaScript-Folder.
Within the Acrobat Document, which you want to obtain a certain file name, you can now use the trusted functions "myTrustedBrowseForDoc" and "myTrustedSaveAs" to store the file. To call the trusted functions and deliver the file name you can either you use a form field (button) or you add a new menu item. Add the following JavaScript Action to the button/menu item and change "Roller Coaster" to the name of the field which contains the value which you want to become the new file name:
var fileName = this.getField("Roller Coaster").valueAsString;
try {
var oRetn = myTrustedBrowseForDoc({bSave: true, cFilenameInit: fileName + ".pdf"});
try {
myTrustedSaveAs(this, { cPath: oRetn.cPath, cFS:oRetn.cFS });
catch(e) {
console.println("Save not allowed, perhaps readonly.");
catch(e) {
console.println("User cancelled Save As dialog box");
Good Luck! -
TextInputCallback changing form field
I have developed a custom security provider which works!
I can get logged in AND using the TextInputCallback handler I can set form fields
to access
when coming in from the login page.
However I can't seem to change or retrieve those values
on the next jsp using the setText function. Do you have to force the event listener
to fire on the TextInputCallback somehow or how do you access those properties
being set?The easiest way to do that is to have two separate text fields, and then
show/hide them based on the selection in the check-box.
On Tue, Jan 29, 2013 at 10:23 PM, Jeff Stevenson -
How to change defauled field value in Appraisal OSA
Hi,
We hav implemented OSA Appraisal Model and it's working fine both in R/3 and from EP.In form template We hav set the column 'Value Input' to Required Entry.
In the HAP Document the field values of that column are never null coz the field value is defaulted to the first entry '1'. How to change the defaulted value in the drop dwn boxes.
Any help will be much appreciated .
Rgds,
Jothi.
Message was edited by: Jothivenkatachalam.PHello Jothi,
Defaulting can be achieved with a value determination, BAdI definition HRHAP00_VAL_DET.
Regards and Groetjes,
Maurice -
How to revise form field value in query and skip validation
Hi all,
I have a 10g form that has a field which I want to manipulate during query. I want to display a different value depending upon its orignal value. I did this with a Post-Query trigger on the field's datablock. However, now, when I attempt a new query, the form thinks I've changed the field (which I did). I want to change the field but trick Forms into thinking there were no updates. How do I do this? Note: the field is a list item that has a style of combo box.
Thanks, MikeAmmad,
The reason is that sometimes the list returns the record group's key value (the second column) instead of the intended value (in the first column). This is because the record group is based on a SQL query. There are some values which are no longer in the table queried by the record group, thus the key value is displayed. I would rather nothing be displayed. As of now, I display a message indicating that there is a problem with the LOV.
I know about using a non-database form field. But I don't have any room left and I don't want to lay the non-database field on top of the database field and then have to enable/disable the two fields.
A friend at work suggested setting update_permission to trick Forms. Tried it but not successful yet.
Thanks, Mike -
Get form field value using an offset
I have a Form created using Perl that has a table with a row for each invoice in a large table. I display all the rows in a table and allow the user to edit some info for each record:
for ($item_cntr = 0; $cntr < $record_cnt; ++$item_cntr)
{ print qq(<tr>
<td><input type="text" name="c_freight_$item_cntr" value="$i_freight[$item_cntr]" onBlur="linetotal($item_cntr)" ></td>
<td><input type="text" name="c_miscamt_$item_cntr" value="$i_miscamt[$item_cntr]" ></td>
<td><input type="text" name="c_price_$item_cntr" value="$i_price[$item_cntr]" ></td>
</tr>);
I want to create a Function that is called when they change the Freight value and that causes the rows total Price (freight + miscamt = price) to be calculated again (without hitting a Submit button on the Form).
I created a Function:
function linetotal(whatline) {
var fixed_freight = "document.editform.c_freight_" + whatline;
var fixed_misc = "document.editform.c_miscamt_" + whatline;
var linetotal = parseFloat(fixed_freight.value) + parseFloat(fixed_misc.value);
document.editform.c_price_whatline.value = linetotal; } }
So, if the first row in the table is 0, then the Function is passed "0" and should get the value of the form fields:
'c_freight_0' and 'c_miscamt_0' and set 'c_price_0' to a new value in the form.
The fixed_freight is showing that the string it has is correct, but it does not get the value from the form. Any ideas?DrClap wrote:
DrLaszloJamf wrote:
DrClap wrote:
Although there are [Java sites|http://www.javaranch.com/] which do have an [HTML and Javascript forum|http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=forum&f=20].
Don't forget the free hugs forum there, too!
You must mean [this one|http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=forum&f=44].
Oh yeah. Are you a JavaRanch regular, Dr.C? I was for a while, but not recently. -
Submit disabled form field value?
Is it possible to disable a form field, but still have it be included in the request object on the form handler page?
For instance, I have a field that is required and the customer wants it disabled so it can't be changed until another checkbox is selected. When the form is submitted, the disabled field value isn't passed. Is there anyway around that, short of changing the customer requirement?
Thanks,
-ShadowYou might try using the property "readOnly"
It applies to textfields/textareas
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/readonly_1.asp?frame=true
This doesn't disable the component - it can still be selected.
It just cannot be edited.
http://www.w3.org/TR/1998/REC-html40-19980424/interact/forms.html#adef-readonly
The readonly attribute specifies whether the control may be modified by the user.
When set, the readonly attribute has the following effects on an element:
Read-only elements receive focus but cannot be modified by the user.
Read-only elements are included in tabbing navigation.
Read-only elements may be successful.
The following elements support the readonly attribute: INPUT and TEXTAREA. Cheers,
evnafets
Maybe you are looking for
-
Do I have to purchase the new Numbers to replace my version 2.3 in order to open spreadsheets already created? Will the new version work with my OS - 10.8.5?
-
How do I change the dimensions of an image? The Image Size dialog box will not allow me to change dimensions. I am taking an online class and the Image Size dialog box looks different than the one I am seeing in Photoshop CC. It has the option to c
-
can somebody help me cause i cant rotate my pics its a message came out when i try to do that.its says the file might be in use or open in another program or the file or folder might be read only
-
MBP 13" (2011) sleep problem
My MBP 13" (early 2011) is not going to sleep occasionally when I close the lid. Please help. It's really annoying behave. :-(
-
For the ISO code there is no unique SAP currency code for ALE
While entering in incomming invoice , we got this error message. "For the ISO code there is no unique SAP currency code for ALE" .Any idea what this error is related to ? Thanks SN