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>

Similar Messages

  • 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!! :)

  • Getting two session varibles into one hidden form field

    In a hypothetical exaple, if my first session variable is kt_user_name and it's value is bestperson, and my second variable session is kt_exerreference and it's value is ex1a, I'd like have the value submitted in the hidden form field to be bestpersonex1a (without any spaces if possible). This is the code that I have for the hidden form field that submits the server variables:
    <br />
    <br />
    <form>
    <input type="hidden" name="exerreference" id="exerreference" value="<?php echo $_SESSION['kt_user_name'].$_SESSION['kt_login_user']; ?>" />
    <br />
    <br />But the form also has a php section above the head that seems to add the values to the databse. Here is the beginning of the code with the the first 4 values:
    <br />
    <br />// Add columns
    <br />$ins_exer1-&gt;setTable("exer1");
    <br />$ins_exer1-&gt;addColumn("user_name", "STRING_TYPE", "SESSION", "kt_user_name"."kt_login_user");
    <br />$ins_exer1-&gt;addColumn("exerreference", "STRING_TYPE", "SESSION", "kt_user_name");
    <br />$ins_exer1-&gt;addColumn("Shapes_present_with_target", "STRING_TYPE", "POST", "Shapes_present_with_target");
    <br />
    <br />My question is how do I also configure the code in the 2nd string of this "Add Columns" code to insert both server variables? When I put one server variable as the value in this code (0n line 2), it only inserted the one session varialbe value (not 2 as are in the form field). As you can see, I currently have "kt_user_name"."kt_login_user" which is givig me server errors.
    <br />
    <br />Here's another idea that didn't work yet:
    <br />
    <br />// Add columns
    <br />$user = $_SESSION['kt_user_name'].$_SESSION['kt_login_user'];
    <br />$ins_exer1-&gt;setTable("exer1");
    <br />$ins_exer1-&gt;addColumn("user_name", "STRING_TYPE", "SESSION", "$user");
    <br />$ins_exer1-&gt;addColumn("exerreference", "STRING_TYPE", "SESSION", "kt_user_name");
    <br />$ins_exer1-&gt;addColumn("Shapes_present_with_target", "STRING_TYPE", "POST", "Shapes_present_with_target");
    <br />
    <br />Any ideas on the correct syntax?
    <br />
    <br />Thanks for any help.</form>

    Günter,
    <br />
    <br />I think I did as you suggested. I put this as the form field:
    <br />
    <br />
    <form>
    <input type="hidden" name="exerreference" id="exerreference" value="<?php echo $_SESSION['kt_user_name']; ?><?php echo $_SESSION['kt_login_user']; ?> <br />" />
    <br />
    <br />and changed back the Add columns section to this:
    <br />
    <br />// Add columns
    <br />$ins_exer1-&gt;setTable("exer1");
    <br />$ins_exer1-&gt;addColumn("user_name", "STRING_TYPE", "SESSION", "kt_user_name");
    <br />$ins_exer1-&gt;addColumn("exerreference", "STRING_TYPE", "SESSION", "kt_user_name");
    <br />
    <br />The form does submit now, but only the kt_user_name server varible is showing up in the exerreference field of the databaswe, not also the kt_login_user server variable.
    <br />
    <br />Any ideas on what to do to get it working right? Do I need to modify the exerreference string in the Add columns section?
    <br />
    <br />Thanks - Dale</form>

  • Click a report button to change a report field value

    Hello All,
    I need to create a report where when a user clicks a report button its image changes and a field relating to that record also changes from "N" to "Y"
    I had a look at this Denes's example located on this link
    http://htmldb.oracle.com/pls/otn/f?p=31517:133:7078361971556070::NO
    The only thing lacking here is the ability to change a record field when the user click the image.
    Would it be possible to change the record field value when the function is called ?
    Hope this makes sense
    Frank

    Hi Jing,
    I don't think it is easy, here is a sample that allows you to choose the page size and orientation (which are different master pages), Adobe LiveCycle Designer Cookbooks by BR001: Season Planner (or Year Planner) PDF Template
    It effectively defines the form against each master page and recalculates the widths and heights when the page selected is made, but I don't know of another way.
    Regards
    Bruce

  • Modify form field value

    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,
    Tony

    Thank 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

  • Who has changed the Custom Field value?

    Dears,
    Need to know the information regarding how to fetch that who has changed the Custom field value from PWA/MPP.
    Example:
    There is a PDP (say ProjectInfo):
    There is a Custom Field added to that PDP (say Project Status = In Progress).
    Now for ProjectA, someone has checked out and changed the Custom Field "Project Status" from "In Progress" to "Closed".
    I need to fetch the information regarding who has changed that Custom field.
    In which direction should I move: Event Handlers, PSI???? Any other stuff?
    Thanks & Regards,
    Shravan

    Hi Shravan,
    I'm not a developer but I do know that you can use an event handler pushing the resource name and date in custom fields.
    Another way is to use a 3rd-party tool like
    FluentPro Audit Tool.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • How Do I Display A Hidden Form Field On Executing A Button (Yes Again But In More Depth)

    Hi,
    Yes, I just asked this question but was not specific enough. Ive looking for code within a JavaScript that will enable a hidden form field within a PDF to be displayed.
    What I am attempting to do is to display form field 'Text1" when the button is pushed executing a check of the system date. Im looking for the code to execute the following:
    If the system date is equal to or greater then '2009/02/01' (yyyy,mm,dd), then display 'Text1'.
    I'm using Adobe pro 8.
    Thank You for any help.

    You could so something like the following in the Mouse Up event of the button:
    // Get system date
    var Now = new Date();
    // Get cutoff date
    var End = util.scand("yyyy/mm/dd", "2009/02/01");
    // Set the visibilty of field Text1 based on the date
    getField("Text1").display = (Now > End) ? display.visible : display.hidden;
    George

  • 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.

  • 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
    Ravi

    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 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.com

    Perhaps 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

  • Form field values in query

    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

  • How to populate a hidden form field with a value passed from another page

    I'm using PHP/MySQL and DW CS4.
    I am trying to obtain the external key for a table, and include it as a hidden field in a form for a second table.
    The user selects a "need" from a list and is taken to a new page which displays the need selected in the prior page and a form the user can fill out with details of his offer, there should also be a hidden field in this form that contains the index to the needs table, this hidden field holds the external key. Most of the code is working, except for populating the hidden field with the external key. I have proven(by printing it to the screen) that I have obtained the external key and stored it in a variable ($saveNeedId) . What I'm unable to do is assign this variable to the hidden field in the form I'm about to store in a table. Sometimes I get zero and sometimes I get the index to the first need in the table. This ought to be simple but I can't get it to work, I must be missing something obvious - still very new to PHP.
    Here's the code that sets up the variable and prints it to the screen for test purposes
          $saveNeedId = "-1";
              if (isset($_GET['needId'])) {
                $saveNeedId = $_GET['needId'];
                print $saveNeedId;
    Here's the code that sets up the hidden fields in the form, the one I'm trying to set up is the first one, needId
         <input type="hidden" name="needId" value="<?php echo $row_rsNeedsUnmet['needId']; ?>" />
         <input type="hidden" name="offerId" value="" />
         <input type="hidden" name="MM_insert" value="form1" />
    The page where the user sees the list of needs is here www.hollisterairshow.com/weneed.php
    I'd really appreciate sone help with this, I've tried all combinations of double quotes, percent signs and nothing works...sigh.
    Tony

    Here's the code that sets up the variable and prints it to the screen for test purposes
          $saveNeedId = "-1";
              if (isset($_GET['needId'])) {
                $saveNeedId = $_GET['needId'];
                print $saveNeedId;
    Here's the code that sets up the hidden fields in the form, the one I'm trying to set up is the first one, needId
         <input type="hidden" name="needId" value="<?php echo $row_rsNeedsUnmet['needId']; ?>" />
         <input type="hidden" name="offerId" value="" />
         <input type="hidden" name="MM_insert" value="form1" />
    <input type="hidden" name="needId" value="<?php echo $_GET['needId']; ?>" />
    I looked at your page. It looks like you figured it out.

  • 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!

  • 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, Mike

    Ammad,
    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.

Maybe you are looking for