Simple Javascript question

Please forgive me, I am very new to JavaScript and Acrobat.

Can someone tell me the phrase I would use to several a number entered by a user; which would be multiplied by a fixed number? Please see image:

The user number of backpacks, they enter the first area, the second box would have several sales of 50.

Please let me know if you have any question. I spent some time trying to get this to work, everything I try the product and error.

Your help is very appreciated!

Hi rachelNS,

You can send me a sample form and I would try it for you.

Then you check the script on your side. Also, I would like to know what is the version of Acrobat you are using?

Kind regards

Ajlan Huda.

Tags: Adobe

Similar Questions

  • Simple JavaScript to set the date

    Hello

    My simple JavaScript to fix the date runs in Acrobat Pro, but when I open the same document the reader he sets the date, but it fails with a pop off getField error dialog box... Here's the error tracking script...

    function populate_date()

    {

    var f = this.getField ("ToDay_Date");

    If (! f.value) f.value = util.printd ("d/m/yyyy", new Date());

    }

    populate_date(); call my function

    Above scripts executed when the document is opened. As a Pro, it is stored under Tools/JavaScripts/Document JavaScript...

    When I open it in the drive then I get the following while he dates the date presented too!

    The built-in functions of EScript Acrobat Version 11.0
    Acrobat SOAP 11.0

    TypeError: this.getField is not a function
    2:folder - level: App:Search Script.js

    I have not put right that I get this error...

    Kind regards

    Jeff P.

    I don't understand what you're talking about... The error message made clear reference to a script of level of the folder called 'search Script.js'.

    You must look for the source of the problem here.

  • Simple Javascript calculation

    Hi - I need help with a calculation simple javascript. I wrote this javascript:

    disadvantages of the var = this.getField ("Text6.0")
    disadvantages of the var = this.getField ("Text5.0")
    If (plan.value! = 0)
    Event.Value = cons.value - plan.value / plan.value
    on the other
    Event.Value = «»

    However, the calculation does not well.  For instance, 105-100 / 100 must be equal to. 05%, however, the script goes out to 0.00%.  Is there a better way to write a script so that the answer comes. 05%?

    Thank you
    Connie

    You need to clarify some things. Your first two lines are if the same variable to the same value. I guess that one of them should be the 'plan' variable, but which?

    Second, you must specify it as the sholw calculation. There are:

    (105 100) / 100 = 5 / 100 = 0.05

    If so, the code would be:

    Event.Value = (cons.value - plan.value) / plan.value;

    But first you need to check to see that plans.value does not evaluate to zero before you run the line of code. This occurs when the plan field is empty, for example. What should be the value of the field when the plan is empty or zero?

  • JavaScript question - do not click on dates in a calendar

    We try on online tennis court booking site. When I click the calendar icon to select a date in the calendar, I can click on the date, but he does not at that date.

    Other browsers such as Chrome and Internet Explorer work fine. It just goes straight to the date I click.

    <"rel = 'nofollow' > http://demo3.onlinecourtreservations.com/Reservations.asp > demo version"

    <"rel = 'nofollow' > http://mum.onlinecourtreservations.com/Reservations.asp > our trial version."

    Here's what I sent to the developer and his answer is below.

    My Question: When you use the calendar for date selection tool, I noticed that it will not to the date on the calendar that I click. I can navigate using the arrows of day view and the view arrows week next to the icon of calendar very well.

    DEVELOPER RESPONSE: The calendar tool is based on javascript, so the security of your browser must allow scripts. To do this, the simplest method is to add your site to the "trusted sites" on your browser.

    The steps I've tried:
    1. the reset of the functionality of Firefox
    2. clear all history
    3. start in Safe Mode
    4. check to make sure that javaScript is enabled and it is.

    I wonder why this works fine in Chrome and Internet Explorer and not Firefox.

    Could someone help me solve the problem?

    Thank you.

    If you use this script, you can change it?

    The pop-up tries to submit a form hidden in the main window using a standard, old SEO method. You can correct the script in the pop-up window, or you can create a reference in the main window.

    Method #1:

    Change the code in the popup

    reservation_window.frmCalendar.submit();
    

    for this

    reservation_window.document.forms['frmCalendar'].submit();
    

    Method #2:

    In the main window, create a global script variable that creates the missing reference:

    window.frmCalendar = document.forms['frmCalendar'];
    

    Once solve you this problem, there is a new number. Web site empty, and when you view the source, you see that there is a problem with one of the hidden form parameters.

    Microsoft VBScript runtime error '800a000d'
    Type mismatch: 'CInt'
    /demo/common/reservationssheet/script.asp, line 25
    

    Since it is on the server, I don't know what goes wrong, but the script apparently don't deal well with a time value start missing. For what it's worth, I get the same error in IE8.

  • If exposed simple of questions?

    Alright fellow programmers.  Once more what I meet a problem I have EVER had with other JAVA programs before.  IAM trying to figure out how to write a simple if statement and I have questions.  I did Google search and have found something to help.  So, if you could please tell me what may be the issue?  The error message is "error {invalid AssignmentOperator. syntax".   Thanks in advance!

    Double BinRadius = (Integer.parseInt (txtRadiusFeet.getText ()) * 12) + Integer.parseInt (txtRadiusInches.getText ());

    FieldChangeListener CalcListener = new FieldChangeListener() {}
    ' Public Sub fieldChanged (field field, int context) {}
    Double BinRadius = (Integer.parseInt (txtRadiusFeet.getText ()) * 12) + Integer.parseInt (txtRadiusInches.getText ());

    {If(BinRadius==0)}
    Dialog.Alert ("Hello");
    }
    };

    Capital I yew?

  • Javascript question (API) labels DYMO

    Hi all.

    APEX 4.2
    11 GR 2 XE database.


    I am trying to print labels directly from APEX through a library of JS of DYMO (DYMO label for javascript framework).
    I want to fetch the XML code for the type of representation dynamically from the database instead of fixed this assignment in JS, which kind I can store all templates for labels in the database and find the one appropriate for the task, I do).
    If I use the fixed code, it works very well, code looks like this (sheet of labels XML is assigned to the variable labelxml in the first few lines):
    function printadres(labeltext )
    {
        try
         { 
    var labelxml = '<?xml version="1.0" encoding="utf-8"?>\
        <DieCutLabel Version="8.0" Units="twips">\
            <PaperOrientation>Landscape</PaperOrientation>\
            <Id>Address</Id>\
            <PaperName>30252 Address</PaperName>\
            <DrawCommands/>\
            <ObjectInfo>\
                <TextObject>\
                    <Name>Text</Name>\
                    <ForeColor Alpha="255" Red="0" Green="0" Blue="0" />\
                    <BackColor Alpha="0" Red="255" Green="255" Blue="255" />\
                    <LinkedObjectName></LinkedObjectName>\
                    <Rotation>Rotation0</Rotation>\
                    <IsMirrored>False</IsMirrored>\
                    <IsVariable>True</IsVariable>\
                    <HorizontalAlignment>Left</HorizontalAlignment>\
                    <VerticalAlignment>Middle</VerticalAlignment>\
                    <TextFitMode>ShrinkToFit</TextFitMode>\
                    <UseFullFontHeight>True</UseFullFontHeight>\
                    <Verticalized>False</Verticalized>\
                    <StyledText/>\
                </TextObject>\
                <Bounds X="332" Y="150" Width="4455" Height="1260" />\
            </ObjectInfo>\
        </DieCutLabel>';
    
              var label = dymo.label.framework.openLabelXml(labelxml);
    
              // set label text
              label.setObjectText("Text", labeltext);
                             
              // select printer to print on
              // for simplicity sake just use the first LabelWriter printer
              var printers = dymo.label.framework.getPrinters();
              if (printers.length == 0)
                   throw "No DYMO printers are installed. Install DYMO printers.";
    
              var printerName = "";
              for (var i = 0; i < printers.length; ++i)
              {
                   var printer = printers;
                   if (printer.printerType == "LabelWriterPrinter")
                   {
                        printerName = printer.name;
                        break;
                   }
              }
                             
              if (printerName == "")
                   throw "No LabelWriter printers found. Install LabelWriter printer";

              // finally print the label
              label.print(printerName);
         }
         catch(e)
         {
              alert(e.message || e);
         }
    };
    but when I try to fetch the same XML from a text field on my form it fails with a "getObjectByNameElement(): no object with name 'Text' was found" error which is a custom error from the DYMO library.
    I'm unable to find the big difference in the 2 approaches. If I test the variable labelxml by putting it in an alert the value seems fine ( it contains the XML string which is in P11_LABELTEMPLATE which is exactly the same as the static assigned text in the previous example ).
    The code then looks like this :
    function printadres (labeltext)
    {
    VR;
    {
    var labelxml = $v ('P11_LABELTEMPLATE'); It's dynamic assignment that fails somehow

    var label = dymo.label.framework.openLabelXml (labelxml);

    the text of the label value
    label.setObjectText ("Text", labeltext);

    Select the printer to print on
    for simplicity just use the first printer LabelWriter
    var printers = dymo.label.framework.getPrinters ();
    If (printers.length == 0)
    launch 'no DYMO printer is installed. Install DYMO printers. « ;

    var printerName = "";
    for (var i = 0; i < printers.length; ++ I)
    {
    Printer printers [i] = var;
    If (printer.printerType is "LabelWriterPrinter")
    {
    printerName = printer.name;
    break;
    }
    }

    If (printerName == "")
    not launch "no printer found LabelWriter. Install printer LabelWriter ";

    Finally, print the label
    Label.Print (PrinterName);
    }
    catch (e)
    {
    Alert(e.message || e);
    }
    };
    I'm not sure if this is an APEX or JS question/problem but I hope someone can point me in the right direction.
    
    Regards
      Bas                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    Hi Arie,

    You have me headed in the right direction.
    It seems to me that there is a CR/LF to CR conversion but in the end that did not really matter, I guess.

    I just made a mistake by copying the XML in a database table. What I did the copy on any of the XML string in the code, including the backslash at the end of the line that is JS (continue on a new line) and does not part of the XML... .not too smart of me is it ;)
    Please help out me.

    Problem solved!

    Kind regards
    Bottom

  • Simple javascript for the drop-down list IF, fills two different fields

    I don't write js, but can grasp what it did when I hang a sample edit and re - purpose. I have a form simple fax that already resets to the opening. Here's what I'm doing:

    User selects the sender's name in the drop-down list of about 15 (grow w / hour)

    Fill in the following text field "sender Fax #" with the number of direct fax (xxx-xxx-xxxx in the js) user

    Are also complete this later text field "sender Ph #" with the number of direct ph of the user (xxx-xxx-xxxx in the js)

    Here is an example which I believe works the way you want: https://workspaces.acrobat.com/?d=gZNDS8dQQNqvwocUufXHNQ

    You have to watch the fields to see how they are implemented and to study different scripts to see how it works. If you have any questions, post again.

  • A simple PHP Question

    Hey guys,.

    I learn some basic PHP to make a simple form, and I have a small question. I have these two test of the PHP, Form.php and acion.php files. What you enter in the form is then displayed via $_POST to action.php that gets displayed. Here are the test sites:

    http://christianstest.info/phptest/form.php

    http://christianstest.info/phptest/action.php

    And for two, verry simple code:

    Form.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>PHP Form Test</title>
    </head>
    
    <body>
    <form action="action.php" method="post">
     <p>Your name: <input type="text" name="name" /></p>
     <p>Your age: <input type="text" name="age" /></p>
     <p><input type="submit" /></p>
    </form>
    
    </body>
    </html>
    

    and action.php


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    Hi <?php echo htmlspecialchars($_POST['name']); ?>.
    You are <?php echo (int)$_POST['age']; ?> years old.
    </body>
    </html>
    

    Now I want to do is have action.php store data entered in Form.php so that someone could link directly to action.php and see what the end user concluded Form.php. Now, if you go directly to a non action.php caching it does nothing for the return of name and age. How can I get this data stick? If in fact, it is not a simple question, can you point me to a tutorial? Thank you!

    You'll want to republish this topic in the Dreamweaver forum:

    http://forums.Adobe.com/community/Dreamweaver?view=discussions

    Take care, Mike

  • validation to a specific table only and simple a question on the dml trigger

    Hi all

    guess I am connected to a database with the user ' scott'/'tiger'@orcl and I have the fire instructions insert on 2 different tables allows say tables is
    (1) emp
    (2) Dept.

    and now I want only to commit the emp table and not the table dept, is it possible to do?

    Another question, I have... are commit simple dml triggers auto or not?

    Concerning
    Rahul

    Mac_Freak_Rahul wrote:

    and now I want only to commit the emp table and not the table dept, is it possible to do?

    No, it isn't. You post a transaction, not a table...
    So if you have handled several tables in your transaction, you agree to be all these changes (via the command commit), or any of them (via restore).

    >

    Another question, I have... are commit simple dml triggers auto or not?

    If your dml trigger manipulate data (a very bad practice by the way), then they just add to all of the changes made to the breast of your transaction, you (as mentioned above), either commit all or none.

  • strings in JavaScript question and location

    Hi all

    Not sure that this is right forum for my question... I have when even a few constant strings in my JavaScript files that I have run these scripts from my inDesign plugin in C/C++ code. Anyone know how I can make localization in scripts files (I don't know how support us localization in C / C ++ files).

    TIA,

    MOR

    See "Location ExtendScript strings" in the JavaScript Tools Guide.

  • simple thread question

    Hello world

    My question is quite simple.  I have two text boxes. I wrote "123" in the first text box and 'abc' in the second area. When I put the two boxes, the content in the second box automatically flowed to the first area, because there was space in the first box. Now the first box shows "123abc", and the second box is empty.

    How to stop Indesign automatically cela. Is this possible?  I know I can do it by screwing the two boxes first then the input data, but I have already entered all my data and it save me a lot of time if I can just have screw now.   Thank you very much!

    Simon

    Until you put frames, insert a frame break in all Type > submenus insert a special character

    Then content don't flow from 1 in frame 2 frame when you put on, because you insert a frame break stops at what happens.

  • Simple Javascript calculator of math - nearby!

    Hi, I am trying to build a simple mathematical calculator Javascript that will do the following on click of a button:

    -Add numbers of textfields imput

    -divide the sum by the number of entries

    -give the average.

    Here is my code. Work (gives rights to answer) but the only problem I have is that the value of the textfield response clears itlsef on the release of the button. But even once, the correct value is briefly indicated in the right textfield.

    You can see the page on:

    http://www.cazacommunications.com/nonTrad/testCalcl.html

    Any clue? Thank you!

    - - -

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; Charset = UTF-8 "/ >"

    < title > Document without name < /title >

    < script type = "text/javascript" >

    function CalculateSum (Atext, Btext, Ctext, shape)

    {

    a. var = parseFloat (Atext);

    var b. = parseFloat (Btext);

    var valueC = parseFloat (Ctext);

    Form.REPONSE.Value = (a. + b. + valueC) / 3;

    }

    / * ClearForm: this function has 1 argument: form.

    It deletes the entry and the answer on the form fields.

    He needs to know the names of the elements of the order ENTRY

    to do this. */

    function ClearForm (form)

    {

    form.valueA.value = "";

    form.valueB.value = "";

    form.valueC.value = "";

    Form.REPONSE.Value = "";

    }

    end of JavaScript functions->

    < /script >

    < / head >

    < body >

    < do action = "" method = "post" > "

    < p > number 1

    < input name = "a." type = "text" id = "a" size = "4" maxlength = "4" / >

    < /p >

    < p > number 2

    < input name = "b." type = "text" id = "b" size = "4" maxlength = "4" / >

    < /p >

    < p > number 3

    < input name = "valueC" type = "text" id = "c" size = "4" maxlength = "4" / >

    < /p >

    < p >

    < input type = "submit" name = "btnMoyenne" id = "BtnMoyenne" value = "average" onclick = "CalculateSum (this.form.valueB.value, this.form.valueC.value, this.form.valueA.value, this.form)" / >

    < input name = 'response' type = 'text' id = 'response' size = "4" maxlength = "4" / >

    < /p >

    < p >

    < input type = "submit" name = "btnEffacer" id = "btnEffacer" value = "Erase" onclick = "ClearForm (this.form)" / >

    < /p >

    < / make >

    < p > < / p >

    < / body >

    < / html >

    The shape is erased because it is present to himself. Simply add a false back to the "submit call:

  • Table Simple Dreamweaver question

    I have so many tables, 100 rows, 5 columns for my data.  Here's my question, is there a way to tilt the table given above then go down and up and down.  All my data is from the old to the new, when I want recent to old.  I know that you can do in Excel by alphabet or date, id there a way DW

    Someone can correct me if I'm wrong, but I'm sure you can't sort a column or row of values in a table html using DW. What you could do is create your list in Excel, sort the list in Excel and copy the range of the table and paste it into DW, which will create a perfect html table. You can also copy and paste from Dreamweaver to Excel, but it is not as simple. You will need to copy and paste a column at a time, and you will have an additional empty line for each line populated.

    Another solution is to create a mySQL table that can be easily sorted and uses PHP to display the table on your page. You must know at least the basics mySQL and PHP to do that, but if want to add constantly new records to your table, mySQL is your best solution. If your table is static, the first solution works perfectly.

  • Simple menu question

    I have a simple graphic menu with javascript mouseovers. I use cfinclude on all of my pages to include the menu. How to keep the image mouseover on that specific page. Is it possible to send a variable with cfinclude? Or should I use another tag?

    Variables in the URL don't make much sense.

    I would normally just something like that...

    aPage.cfm

    
    

    menuInclude.cfm

    
         
    
         
    
    
    
         
    
         
    
    

    There are countless variations on this according to exactly how you want your menu to work, but it gives you the basic idea.

  • JavaScript question calling location.href

    Hello

    I'm calling a function javascript to the click event of a command button.
    function test1() {}

    Alert ("Simple alert");
    Location.href='/context/faces/test';
    Window.Location='/Context/faces/test';

    }

    The redirect does not work the method here. If I Uncomment alert in the method and accept the alert from the rediredirection that happens. Someone tell me the issue here? Is there another way to have the redirect using javascript?

    Thank you
    Bastien

    Yes, that seems correct (I wanted to say in the case of page 2, back to page 1). You use a binding of the ADF, and if so, what are the conditions of discount for the iterators on page 1?

    John

Maybe you are looking for