Help with Javascript syntax error

Hello

I'm very new to all this. I have manged to write a script that will change the text in the field based on the text of another field. It sometimes "works", but the form freezes and crashes which I assume is because there is something wrong with my script. Any help would be appreciated.

I put the script in the calculate-> custom calculation script box

If ((this.getField("Email_Type").value == 'RSVP Reminder')) {}

Event.Value = "Date:";

}

else if ((this.getField("Email_Type").value == 'Login Webinar')) {}

Event.Value = "Date:";

}

else {}

Event.Value = "";

}

I think I solved my problem. It looks like the place to check for each line, I need to declare the variable.

If ((this.getField("Email_Type").value == 'RSVP Reminder')) {}

Event.Value = "Date:";

}

else if ((this.getField("Email_Type").value == 'Login Webinar')) {}

Event.Value = "Date:";

}

else {}

Event.Value = "";

}

Tags: Acrobat

Similar Questions

  • Need help with PHP syntax error

    I fight with this error message ""Parse error: syntax error, unexpected T_IF ' for the 66 line that I get. " Here is the code that I use that I got with the help of the users of this site, which is supposed to launch a search for multiple parameters on a mysql database. The red text is the line 66. I just starting to learn PHP and I can not know what to do with it. Is it possible to have two if statements following each other like this? In addition, as I said, I was given this code from the help of this forum, but I don't understand what the purpose is of the $where variable. This code will work also without it? Thanks in advance for any help.

    $query_rsMainItems = ' SELECT * FROM mainitems; $where = false; If (isset($_GET['category']) & &! empty($_GET['category'])) {$. query_rsMainItems = 'category WHERE ='.} GetSQLValueString ($_GET ['category'], 'text');      $where = true; } If (isset($_GET['price']) & &! empty($_GET['price'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = 'price ='. GetSQLValueString ($_GET ['price'], 'text'); } If (isset($_GET['time1']) & &! empty($_GET['time1'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = '(EDT) 1 ='. GetSQLValueString ($_GET ['time 1'], 'text'); } If (isset($_GET['time2']) & &! empty($_GET['time2'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. is 'time2 ='. GetSQLValueString ($_GET ['time2'], 'text'); } If (isset($_GET['city']) & &! empty($_GET['city'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = 'city ='. GetSQLValueString ($_GET ['city'], 'text'); } If (isset($_GET['zip']) & &! empty($_GET['zip'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = 'zip ='. GetSQLValueString ($_GET ['zip'], 'text'); } If (isset($_GET['neighborhood']) & &! empty($_GET['neighborhood'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}   } $query_rsMainItems. = 'quarter ='. GetSQLValueString ($_GET ['suburb'], 'text');

    I copied and pasted the code in a local page. Aside from a missing brace after the last line ($query_rsMainItems. = 'quarter ='.) GetSQLValueString($_GET['neighborhood'], 'text');), it works perfectly.

    The error message is a unexpected T_IF in line 66. This means that the PHP engine is not expected a conditional clause at this time here. In all likelihood, there is an error at an early stage in the code, which resulted in an unmatched brace.

    The code I provided works. I tested completely before posting originally and tested again. The problem is that I tested it in isolation from the rest of the code in your page. Without seeing the whole page, it is impossible to determine where the error is located.

  • Help with Javascript syntax for dynamic header / footer...

    Hello-

    I am very new to JavaScript, but I managed to frankenstein two snippets of code that work well individually, but I can't understand how to make them work together. I am applying a dynamic header and footer to a large number of documents using the batch. Here are two extracts that work, and if someone could help me to combine them, I would be very grateful!

    for (var pageNumber = 0; pageNumber < this.numPages; pageNumber ++) {var DateStamp = this.addField ("DateStamp", "text", pageNumber, [10, 15, 600, 0]);} DateStamp.textSize = 12; DateStamp.alignment = 'center'; DateStamp.textColor = color.gray; }

    this.setAction ("WillPrint", "this.getField('DateStamp').value = \"THIS DOCUMENT IS VALID FOR 24 HOURS from DATE of PRINTING:-"+ util.printd (" \"mm/dd/yyyy hh: mm tt\", new Date()) "");

    for (var pageNumber = 0; pageNumber < this.numPages; pageNumber ++) {var FilePath = this.addField ("path", "text", pageNumber, [10, 782, 600, 767]);} FilePath.textSize = 10; FilePath.alignment = "left"; FilePath.textColor = color.gray; }

    this.setAction ("WillPrint", "this.getField('FilePath').value = \"File path: \ "+ this.path");

    Thanks in advance for any help!

    The only problem is that your second order setAction is overwhelming the first. Simply combine it with a single command, as follows:

    this.setAction("WillPrint", "this.getField('DateStamp').value = \"THIS DOCUMENT IS VALID FOR 24 HOURS FROM PRINT DATE: \" + util.printd(\"mm/dd/yyyy  hh:MM tt\",new Date());  this.getField('FilePath').value = \"File Path: \" + this.path;");
    
  • Help with the MuseJSEssert error in safari

    Hello

    My site works fine in google chrome, firefox on android, but will not load on my mac in safari, or on an iphone...

    Suggests his problem with safari, rather than with my site?

    I get this error...

    MuseJSAssert: Error calling the function switch: TypeError: undefined is not a function (assessment ' $(elem) .museMenu () ')

    Anyone got any ideas?

    Thanks in advance

    You can refer to these discussions:

    MuseJSAssert: Error calling function of selection: [Object Error]

    Need help with error MuseJSAssert

  • Help! -Line1: Syntax error-

    Hello

    The difficulty to launch my VMWare XP machine this morning. Give me the ' Line1: syntax error "problem.

    I have read some other posts in this regard but really could not understand what I need to fix.

    Attached are my log files.

    Any help would be very very greatly appreciated.

    Thank you.

    The attached file "Windows_XP_Professional.zip" contains a "Windows XP Professional.vmx" file created from the contents of the file "vmware.log" and you can use it to replace the damaged one.

    Attached file: 'Windows_XP_Professional.zip. '

  • Need help with Javascript for Acrobat 9 Pro

    Hello

    I have created a PDF form in Adobe Acrobat 9 of Profession.  Not having not much experience with Javascript, I found this forum very helpful and have many examples of script used to other issues, I had.  I was hoping that someone could help me with the following script, I tried many variations, cannot operate.

    var ratio = this.getField("ratio").value
    concentration of var = this.getField("concentration").value
    var result = this.getField("result").value
    If (ratio.value > = 50.00)
    {result.value = 'PASS' ;}
    If (ratio.value".value > = 40.00)
    {result.value = 'PASS' ;}
    If ((concentration.value ==61) & & (ratio.value > = 49,25))
    {result.value = 'PASS' ;}
    If ((concentration.value ==61) & & (ratio.value > = 39.25))
    {result.value = 'PASS' ;}
    If ((concentration.value ==62) & & (ratio.value > = 48.50))
    {result.value = 'PASS' ;}
    If ((concentration.value ==62) & & (ratio.value > = 38.50))
    {result.value = 'PASS' ;}
    on the other
    {result.value = "FAIL" ;}

    It's just a piece of code, concentration values run from 61 to 99 and the value of the ratio varies for each value of the concentration, there is a high ratio and a low ratio.  The result of this field to complete the field of results with a SUCCESS or a FAILURE.  This isn't working... any help is greatly appreciated!

    If this script is attached to the Calculate of the "result" field event, if I understand correctly the logicm code should be something like:

    // Get a reference to the ratio field
    var ratio = this.getField("ratio");
    
    // Get a reference to the concentration field
    var concentration = this.getField("concentration"); 
    
    // Default
    var res = "FAIL";
    
    if (ratio.value >= 40.00) {
        res = 'PASS';
    }
    
    if ((concentration.value == 61) && (ratio.value >= 39.25)) {
        res = 'PASS';
    }
    
    if ((concentration.value == 62) && (ratio.value >= 38.50)) {
        res ='PASS';
    }
    
    // Set this field's value
    event.value = res;
    

    If the code is placed elsewhere, you must indicate the location.

  • excessive Javascript syntax error notification

    The new parser of Javascript in CS4 puts a yellow bar at the top of the Code view that says "there is an error of syntax in line [line number]. Indicators of code may not work until correct you this error. »

    The problem is, it does not include when the 'syntax error' occurred because I am not finished simply type a line yet. for example if I type "var x =" and then put in pause for half a second (for example to think about should I put x in), I get this notification. "»

    What can be done to fix this?

    eliot1785 wrote:
    > Of course, but the real problem is that the yellow bar all pushes down. So, basically, the code bouncing up and down as I type - pretty boring.

    In the toolbar of Code, there is a button "syntax error alerts in Info Bar" roughly in the middle of the tool bar. Click it and the yellow bar should stop appearing.

    --
    Danilo Micen
    | http://blog.Extensioneering.com/
    | Extensioneer WebAssist
    | Adobe Community Expert

  • Need help with the Blue error screen.

    I'm having problems with the Blue error screen at startup which said "less than or equal Driver_IRQL_not. He entered the State of memory dump & black screen after that.  Nothing was abnormal after checking all the drivers in windows 7 Edition Device Manager Home premium. I'm really lost as to what causes it? My computer is a toshiba satellite laptop computer P840 pourrait-someone ' a please advise me on this matter. Thanks in advance for your patience.

    Dear Zigzag3143,

    I finally managed to fix the problem by the chance. I had discovered that this problem was caused by the sypnatics of the laptop touchpad driver. Uninstalled A & reinstall it with the correct driver from the laptop manufacturer websites. Did not expect that it is the cause of all the problems. Thank you for your valuable advice.

  • Need help with javascript used to check the data in the mandatory radio button fields

    required_fields

    I get a syntax error (SyntaxError: missing: after the id property 17; at line 18).  I am trying to run a script to verify data in all the fields required radio button before letting the user to submit the form (or save).  Here is the code I use:

    var AllRequiredFieldsSet = true;

    for (var i = 0; I < this.numFields;i++)//loop through all form fields)

    {

    var fldName = this.getNthFieldName;

    var currentFld = this.getField (fldName);

    if(currentFld.type=="radio")

    {

    All the radios that are needed to see if the user filled their

    if(currentFld.Value=="OFF")

    AllRequiredFieldsSet = false; one of the option boxes has not been selected, this form cannot be sent

    }

    }

    If (AllRequiredFieldsSet is false)

    App.Alert ("all the required areas have not been met");

    on the other

    this.submitForm ({cURL"mailto:EMAILADDRESS@gmail.com", cSubmitAs: "PDF"});

    Miss me not all media... Any ideas on what I'm missing?

    Thank you! Judy

    These two lines should fix things:

    var fldName = this.getNthFieldName (i);

    ...

    if(currentFld.type=="RadioButton")

  • help with JavaScript errors when opening Dreamweaver CC

    Since 3 days when I opened Dreamweaver CC on my Mac OS 10.8.5, I have 2 different JavaScript errors: "InternalError: unexpected end of data", and "InternalError: cannot decode JSPrincipals" Dreamweaver seems to work ok, with the exception of copy / paste, but couldn't find a way to clean up the errors.

    Ahh... found, had to use go and type in ~/library to get there. Thank you!

  • Need help with incorrect syntax for an update error

    I get the error message below, but I can't understand what I'm doing wrong.

    Run database query error.

    [Macromedia] [SQLServer JDBC Driver] [SQL Server] Incorrect syntax near the keyword 'WHERE '.

    The error occurred in C:\ColdFusion9\wwwroot\Intranet\DM\Admin\Maintenance-BulbBaseType.cfm: line 23

    21: UPDATE [bulb Type of basic table]

    22: SET [BulbBaseTypeDesc] = "#TxtBulbBaseTypeDesc #",.

    23: WHERE ([BulbBaseTypeID] = #TxtID #)

    24: < / cfquery >

    25: < cfset TxtID = 0 >

    I put my cfparam as:

    < name cfparam = 'Submit' default = "" >

    < cfparam name = "TxtID' default = 0 >

    < name cfparam = default "TxtBulbBaseTypeDesc" = "" >

    Thank you. I'm new to ColdFusion and it's someone other code. I appreciate the help.

  • Help Adobe javascript syntax

    Hello

    Greetings to all. I am a new to Acrobat javascript and the forum and should be grateful for pointers on a problem with a script that I write.

    The script is automatically filled a text field (Text1) with a fixed number based on selections made in a combobox (ComboBox1) and control (Checkbox1) checkbox. ComboBox1 has 4 ads (DC, AC, BC, AX). Text1 should return the number 3 only if ComboBox1 <>DC and Checkbox1 = checked.

    Individual conditions on their own works. If the below script returns a 3 in Text1

    If (this.getField("CheckBox1").value! = 'Off') {}

    Event.Value = 0.03;

    } else {}

    Event.Value = 0;

    While this also returns a 3 in 1 text

    If (this.getField("ComboBox1").value! = 'DC') {}

    Event.Value = 0.03;

    } else {}

    Event.Value = 0;

    However, when I have them unite, the script fails

    If ((this.getField("CheckBox1").value! = 'Off') & & (this.getField("ComboBox1").value! = 'DC')) {}

    Event.Value = 0.03;

    } else {}

    Event.Value = 0;

    The problem does not seem to include syntax, but after having spent a lot of time looking at it do not see directly. What I am doing wrong?

    Thank you very much

    In all of your codes, you are missing the closing at the end brace...

    If you encounter problems of syntax (like this), then it should be very obvious, because you will get error messages in the JS console when you change the value of any field.

    If it is a problem of logic while there will be no error message, it will not work properly.

  • Please help with javascript

    Hi all
    In my application, there is a colujmn in a table with the date field (calendar) and 2 other fields. The user is not allowed to enter later in the date field, I used a javascript script and it worked fine, but later I discovered that this works only for the future date, (not months or year) assume that, if the date is November 15, 2010, the error is thrown, otherwise if the date is October 15, 2010, error is thrown , for dates like December 10, 2010, December 10, 2011... error is not thrown, that is to say in the coming months and the year is NOT thrown.
    I used the code below:
    < script language = "JavaScript" type = "text/javascript" >
    function test (SAVE)
    {
    for (var i = 1; i < = 30; i ++)
    {
    "" var i1 = i + "";
    if(i<10)
    I1 = '0' + i;
    var datval = document.getElementById("f04_00"+i1).value;
    If (datval! = null & & datval > ($v ('P10_FUTURE_DATE')))
    {
    Alert ("You entered at a later date that is not valid.");
    document.getElementById("f04_00"+i1).value = ";
    document.getElementById("f05_00"+i1).disabled = true;
    document.getElementById("f06_00"+i1).disabled = true;
    counter ++;

    }
    on the other
    {
    document.getElementById("f05_00"+i1).disabled = false;
    document.getElementById("f06_00"+i1).disabled = false;
    }
    }
    if(Counter==0)
    {
    doSubmit (SAVE);
    }
    }
    < /script >

    If the incorrect date is selected, the first value in the column is disabled and the other columns fades.
    Another problem I'm facing here is the calendar does not close when you selected the value, I have to close it manually.

    Please help me with the code!

    Hello

    OK - you should check the settings on the report and the process.

    For each column in the report, check that reference parameters owner of the Table, name reference Table and column name of reference are executed correctly. Note that the reference column name must match the name of the column or the name of the alias, as defined by the SQL statement.

    For each process, make sure that the owner, Table and primary key column name are executed correctly - it should be the same for all processes in the form of tables.

    Andy

  • Help with 14400 ORA error while inserting data

    Hi all

    I am facing an error ora-14400 in the following scenario, please help.

    I created a table using the syntax:

    CREATE TABLE insert_table
    (
    NUMBER OF GRPKEY (20, 0) NOT NULL,
    N NUMBER (10, 0),
    JOVAN VARCHAR2 (250 BYTE),
    APC VARCHAR2 (2 BYTE),
    SID VARCHAR2 (65 BYTE),
    RDATETIME VARCHAR2 (BYTE 19),
    NUMBER OF CKEY (20, 0),
    AVER VARCHAR2 (25 BYTE),
    VARCHAR2 (250 BYTE) CVER,
    TNOM VARCHAR2 (50 BYTE),
    SCODE VARCHAR2 (30 BYTE),
    PTAPEZ VARCHAR2 (50 BYTE),
    NUMBER OF FILENUMB (10, 0),
    NUMBER OF LINENUMB (10, 0),
    DATE OF ENTRY_CREATEDDATE
    CONSTRAINT temp_table_PK PRIMARY KEY (GRPKEY))
    PARTITION OF RANGE (ENTRY_CREATEDDATE)
    (PARTITION P0 VALUES LESS THAN (TO_DATE (' 2009-01-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIAN ')))
    );


    When I try to insert data using the:


    insert into insert_table values
    (1, null, null, null, null, null, null, null, null, null, null, null, null, null, November 1, 2010 "");

    I get the following error output:
    Error report:
    SQL error: ORA-14400: inserted partition key is not mapped with any partition
    14400 00000 - "inserted partition key is not mapped to any partition.
    * Cause: An attempt was made to insert a record into a beach or a Composite
    Range object, with a concatenated partition key that overflows
    the concatenated partition bound list of the last partition - or-
    An attempt was made to insert a record into a list object with
    a partition key that does not match the specified literal values
    for all partitions.
    * Action: Do not insert the key. Add a partition capable of accepting
    the key, or add values corresponding to the key a partition specification

    Hi Chaitanya,

    Change your table script to

    CREATE TABLE temp_table
    (
    GRPKEY NUMBER(20, 0) NOT NULL,
    UKEY NUMBER(10, 0),
    ANUM VARCHAR2(250 BYTE),
    APC VARCHAR2(2 BYTE),
    SID VARCHAR2(65 BYTE),
    RDATETIME VARCHAR2(19 BYTE),
    CKEY NUMBER(20, 0),
    AVER VARCHAR2(25 BYTE),
    CVER VARCHAR2(250 BYTE),
    TNAME VARCHAR2(50 BYTE),
    SCODE VARCHAR2(30 BYTE),
    PTYPE VARCHAR2(50 BYTE),
    FILENUMB NUMBER(10, 0),
    LINENUMB NUMBER(10, 0),
    ENTRY_CREATEDDATE DATE
    , CONSTRAINT temp_table_PK PRIMARY KEY (GRPKEY))
    PARTITION BY RANGE(ENTRY_CREATEDDATE)
    (PARTITION P0 VALUES LESS THAN(TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P1 VALUES LESS THAN(MAXVALUE)
    );
    
    insert into temp_table values
    (1,null,null,null,null,null,null,null,null,null,null,null,null,null,'01-NOV-2010');
    1 row inserted
    

    or refer the question about the "Date of partitioning of a table"
    * 009 *.

    Published by: 009 November 3, 2010 23:29

  • Help with «throw exception error native function»

    Can someone help me find a soultion error with dreamweaver mx2004. I use the software successfully for several years and everything has started to develop a new site with .htm files.

    When connecting to a css file, I get the following error when I swith from design mode, the system displays the error code, then crashes, but only on a single page, another page using the same css file works fine! I'm totally baffled...

    The error is:

    When executing command DW_DesignView in toolbars.xml, the following JavaScript error occurred: exception throw in native function


    I hope that its not me, but it just may be, please help.

    If this is the case with a single file, there is something wrong with this file. Or to be more precise, there is something in this file that gives indigestion to Dreamweaver. You must check the file with the validator W3C CSS (http://jigsaw.w3.org/css-validator/).

    There is a known issue with Dreamweaver CS3, for which a file that is exactly 8 KB or multiples of it causes Dreamweaver to crash. I've never heard of him with Dreamweaver MX 2004, but if the file is valid, try to open it in a text editor and add something, as a CSS comment. This increases the size of the file and get rid of the problem.

    If these ideas do not resolve the problem, I'm afraid, I'm out of ideas. Adobe will not help you because your version of Dreamweaver is no longer supported.

Maybe you are looking for

  • GPIB bus schedule

    Hello I'm new to programming level of registry GPIB. I have some experience in GPIB, but my previous experience was using more higher level programming.  I try to control the GPIB bus with my test Board, which consists of a CPU + NAT9914, as well as

  • HP ENVY 7640: all new HP ENVY 7640 gets msg "Printer busy" when you try to fax doc to computer

    All the functions of the printer I checked so far work very well: copy, fax directly from the printer receive fax, scan to computer, etc..  But I get msg "Printer busy" when you try to fax doc to computer.  My installation conforms to guide: distinct

  • instruments running in parallel with a slight twist

    Hello, first post here. I am very new to labview (less than 2 weeks) and I'm currently learning C++, so I don't have a ton of experience shows. I work with a research group in a summer internship, and I am currently working on writing the code for a

  • Windows calendar reminder utility

    Hello. I have Windows Vista 32 bit. I can't get the the calendar reminder of Windows to work when the program runs, eventough "reminders should show when Windows Caldendar is not running" in the dialog 'Options' is checked. I missed some jobs because

  • What happens to the system folders, when the volume is dismounted?

    Hi allI'm having trbl with Windows Vista Home Premium 32-bit on a laptop computer, which had its main drive partitioned into 3 different partitions: C for the OS, the D for my data and E for backup images.Some of the 'system' (blue color), records su