How to create a simple so that the else statement

I tried for hours to find out how a simple calculation to display text in a field that is based on what is selected in another drop-down list.  My first time doing so, I'm not sure what I'm doing wrong.  Here's what I have so far:

get the value of the field doctor

var doctor = this.getField("Physician").value;

Display according to chosen doctor number

if(Physician=1) event.value = 100;

ElseIf (physician = "2") event.value = 200;

ElseIf (physician = '3') event.value = 300;

else event.value = 0;

You have made the classic mistake of using the wrong operator in if statements. The operator if in JS is 'is' (or ' = '). '=' is the assignment operator.

In addition, in the first statement, you compare the values of a number and later on a string. You must be more coherent.

Then use this code:

// get the value of the Physician field
var Physician = this.getField("Physician").valueAsString;

// Display Number depending on Physician selected
if (Physician=="1") event.value = 100;
else if (Physician == "2") event.value = 200;
else if (Physician == "3") event.value = 300;
else event.value = 0;

See your code, however, I don't think that you need an if at all... This code should do the same thing:

event.value = Number(this.getField("Physician").valueAsString) * 100;

Tags: Acrobat

Similar Questions

  • I am very new to dream. I created a simple site that worked very well. I tried SEO booster and was checking on things different (for example Goigle webmaster). I don't know exactly what I did, but now when I type in my site it says the Palestinian Authori

    I am very new to dream. I created a simple site that worked very well. I tried SEO booster and was checking on things different (for example Goigle webmaster). I don't know exactly what I did, but now when I type in my site it tells me that the page cannot be opened because it was redirected too many times...? Help, please!

    Let me add some details to the choice in the scenarios you have for the use of domains.

    The areas are to simplify all kinds of activities on the Internet for users. Instead of addressing your email to go to the software from e-mail server to a computer with the IP 113.78.59.238 number, users can simply run their mail to "hannah" @ "gmail.com" or go to the website to "gildedgraces.com". This makes things a lot easier for users, but requires a little more difficult techniques backstage, because Internet computers connected and hardware (servers, tablets, phones, refrigerators) have only single numbers, not names. So, how internet needs to know which computer manages all emails for "@gildedgraces.com", and where physically this site 'www.gildedgraces.com '? This is where the "Domain Name Servers" kick in. They maintain long lists of these domain names, with references to the IP numbers correct and up-to-date. In this way, technicians can also easily Exchange computers, servers, connections, where a site is moved to another host, or when a server suddenly collapses. These things will happen, things have to change. They want to update certain IP numbers in the list on the DNS servers. I have it?

    So in order to get a Web site running, you know where your domain registry database is guarded and kept safe, and where your Web site is physically located.

    Note the difference between DNS (or servers) and the service (or Web servers) throughout all the instructions and documentation.

    Now, have a look at this PDF that was returned by Brad, in his response above.

    The domain name can be registered at any domain provider and the registry itself is not always need to reside there. You could relegate (you might say "move" or move) the registry for the DNS to another provider (like BC) service. In such a scenario, he must tell the provider holding the credentials of your registry, to redelegate it in British Colombia. That's what the article 4 in the PDF file. And of course, BC DNS service can internally so all applications for this field to their own web server.

    You can also choose to keep your current domain provider maintains the registry, but that their DNS servers before any request of this area on the web servers of British Colombia, where your site is published. This is typically a necessity for registrations from non-American, since many extensions of national domains (such as .nl and .de) can be recorded by suppliers outside of this nation. So the registry simply cannot be moved to an American company (it's a legal thing). In such a situation, article 6 of the PDF comes into play, describing what BC would normally internally: to the domains of the physical location of the Web site.

  • How to create an action link that goes to a section that is 'hidden' in the same page

    Hello

    OBIEE 11, I have a dashboard page that has section 1 as a guest, 2 which shows an analysis that contains a chart and article 3 that shows the details of the graph. I have an action to link this graphic article 2 connection to the details in section 3. However, I would like my report to the do not appear in article 3 as long as you press the link of action. Is there a way to 'Hide section 3 until you press the link action?' Thank you!

    Hello

    Try to avoid the double-display: How to create an action link that goes to a section that is 'hidden' in the same page

    Felipe_Idalgo meets the other post (and he posted the best answer to your needs), in order to continue the other thread instead of opening another.

  • How to create a Java application that receives Messages from Web site.

    Hello

    I'm a c# developer, and I am new to programming Java with Eclipse.

    How can I create a simple application that listens on a port for incoming text Messages.

    In c#, I can do this in 5 minutes but in Java, well, I don't know.

    Help out me of the good people

    Research advance for your answers

    Hamid Weiss

    Here is an article that will help you:

    http://supportforums.BlackBerry.com/T5/Java-development/different-ways-to-listen-for-SMS-messages/TA...

    Unfortunately, this is the easy bit.  The hard bit is creating the application and have it run in a background Thread.

    For this, I recommend study you the samples provided and understand how they work.  The website is also a good source of material and explanations, as of course is this forum.

    You might find this useful too:

    http://supportforums.BlackBerry.com/T5/Java-development/tutorials-for-new-developers-part-1/m-p/1621...

    Good luck.

  • Smartphones blackBerry how to create a new folder in the video folder in the media

    Hi, I'm trying to figure out how to create a new folder in the video folder in the media. I can easily create new folders in the pictures folder, but not in the videos... Why? Thanks in advance for your help.

    well I'm sorry, I think that I have not read your emails correctly.

    The media application doesn't care about records at all. It will read the files, the tags when they are available, playlists, but it will not show the files. with the exception of the pictures.

  • Windows Media Player 12/Windows 7; Why my computer says "Windows Media Player cannot read the Blue Ray Disc. The disk has been created in a way that the player does not support.

    Why my computer says "Windows Media Player cannot read the Blue Ray Disc. The disk has been created in a way that the player does not support "?  I have Windows Media Player 12 and it comes a new movie.  I can play other discs blue ray on this computer, but not this one.  Is there an update that I'm missing or a codec I need?

    Thank you

    This new film format is not supported by Windows Media Player, here is a link on how to play a dvd on windows media... player and codecs...

    http://windows.microsoft.com/en-us/windows7/Play-a-CD-or-DVD-in-Windows-Media-Player.

    If you can not play... try using third-party codecs, but at your own risk :D

    Hope this helps you :)

  • How to create a Viewer without buying the image? I want to be able to save the images I'm looking a subject without purchase or download.

    How to create a Viewer without buying the image? I want to be able to save the images I'm looking a subject without purchase or download.

    After talking to the Customer Service, I now get it. Thank you.

    That is to say: down arrow recorded a watermark image in the gallery without you buy. You can download an overview lores on your desktop for motorhomes with this same arrow, but it is unfortunately a watermark (unlike the DPC). You can also copy and send a link to the Gallery clients to review before you buy.

  • Please how to create an e-commerce using the muse of adobe

    Please how to create an e-commerce using the muse of adobe

    ECWID is certainly the easiest to customize muse and it's very easy for customers to add/manage products. Another thing that many people love in Ecwid, it's that you can host several stores account. If you know css/javascript then you can do this on your own, but if you want a widget that does, make these widgets.

    If you are looking for some great Ecwid widgets, you can enter these ones that are free. And if you are wanting to customize even more (including the ability to host multiple account stores), you can get these even more impressive widgets for $14.99 with promo code: 1MUSESTORE #.

  • How to create a simple poll

    How to create a simple poll and view the number of clicks the radio button above?

    Customer says drupal PSI and it's easy, very difficult to find features here, any suggestions please

    British Colombia, you will need to create a web application and use the liquid and/or Javascript to perform a survey. Nothing out of the box I know.

  • How to create a report based on the item selected from the list of selection?

    Hello

    I created a tables_LOV based on:

    Select table_name table_name user_tab_cols r, d

    where column_name like '% _type % '.

    Then I created a ListOfTables page element, display in a selection list and pointing to tables_LOV.

    I run the page, and I can choose the table I want in the drop-down list.

    How to create a report based on the selected element? (ex: select * from selected_table)

    Thanks in advance

    Salah

    Hi Salah,

    Allright, take a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report

    I think that simulates what you are trying to accomplish. I've implemented the simplest method I could think of.

    The report is based on a collection of apex. If you are not familiar with this, you should study the documentation: APEX_COLLECTION

    To recreate my example, you should:

    (1) create a report (interactive) on your collection

    SELECT *
       FROM APEX_collections
     WHERE collection_name = 'MY_COLLECTION'
    

    (2) create a selection list page_item for the tables that you want to display (in my case, this is called "P38_TABLES")

    (3) create a dynamic action that triggers on the evolution of your selection list page_item. Dynamic action must be a parade of PL/SQL procedure the following code:

    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
    
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
        );
    end;
    

    Make sure that you add your page_item 'Page to send items' section.

    (4) add a real extra action that makes an update of the report area.

    Here are two photos describing the da:

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA1.PNG

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA2.PNG

    Good luck and greetings,

    Vincent

    http://vincentdeelen.blogspot.com

  • How to create a gallery page that you can click on an image, expand it and move left or right to see more images?

    How to create a gallery page that you can click on an image, expand it and move left or right to see more images?

    @

    You can use the slideshow widget to do this. For more details: Adobe Muse Help | Working with slide show widgets

  • How to create checkbox with HTML in the labels?

    How to create checkbox with HTML in the labels?
    If it is possible without the help of APEX_ITEM. BOX?

    Hello

    Yes you can do it. You just need to set * "Escape special characters" = No * in the area of 'Security' of the page box point you. But please be aware that this change could make your application vulnerable to XSS attacks in the case if users are allowed to enter data into the table that is used to fill the entries in the box.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • How to make a simple function on the liberation of a mouse AS3.0?

    so its been a while that I was Flash Professional and I'll have to re - educate myself in almost everything. what I want to do is to create a simple function of the liberation of a mouse click vs what is the command to access freedom I know the click is MouseEvent.CLICK, function, but what is the command to access release on?

    You probably want to use MouseEvent.MOUSE_UP (which is what happens to define the end of a CLICK event)

  • How to create crystallize effect like that?

    How to create crystallize effect like that?

    46e0c14de2e8c0b7db52a5123fef497b.jpg

    I know that this can be done with the "3D postcard" and make the settings (vertices, edges, lights).
    But how can I create crystallized texture even like that? Then, which would create "postal 3D map.

    But how can I create crystallized texture even like that?

    You can not. Not in PS. It is a Voronoi tesselation motif created by dividing a contour of mesh 3D accordingly. Of course the filter Crystalize product model, but like cards post 3d are based on uniform grid subdivision, you do not get the vertices and edges. There you go...

    Mylenium

  • How to create an interactive cursor that returns a numeric value.

    Hello world

    I am trying to create an interactive slider that the user can drag an icon from left to right, in order to select a numerical value. This numeric value will be output to a dynamic text box to capture the data. Please see the example at the link below...

    http://www.carbontrust.co.UK/solutions/CarbonFootprinting/carbonfootprintindicator.htm

    I welcome suggestions of action script to create a slider like that.

    Thanks for your help

    Just as an example, open a new file and add a movieclip on the stage... give it an instance name of "handle" and place it at x = 0, y = 100.  Then place this code in a layer of actons (code red, it's how the drag limits are set)

    handle.addEventListener (MouseEvent.MOUSE_DOWN, mouseDown)

    function mouseDown(event:MouseEvent):void {}
    handle.startDrag (false, new Rectangle (0, handle.y, 200, 0));
    }
    handle.addEventListener (MouseEvent.MOUSE_UP, mouseReleased);

    function mouseReleased(event:MouseEvent):void {}
    handle.stopDrag ();
    }

Maybe you are looking for

  • Enable Web Services on HP LaserJet CP1525nw

    We are trying to install web print on HP LaserJet CP1525nw service. This is a printer over the network from a server windows server 2008 R2 for Windows 7 x 64 machines It is connected to a network wired and all (printing etc.) works execpt WebService

  • foto ontdubbelen ik dat hoe doe?

    Hoe ontdubbel ik foto'; s in mijn foto 17000 ca van bestaand?

  • With the help of the Executive trial switch

    Hi Ppl, I'm using LabVIEW 8.6 trial. When I installed switch via the drivers, I found switch Executive VI are not there. But the installation program displays the NOR - features of the SWITCH must be installed. When I checked the vi.lib file, SwitchE

  • Rearrangement of the desktop icon

    How can I get my computer constantly rearrange my icons on the desktop by name, when I take the time to arrange them in a special, convenient order? They don't reorganize until my computer is restarted in an update or stop. Because I put in sleep mod

  • MS Security Essentials corrupt Adobe Master Suite CS4 programs, treating it as a threat.

    MSSE dealing with Adobe Master CS4 Suite as a threat and has disrupted the programs to work properly. Hard to believe that Microsoft has not found that the Adobe programs are not a threat. In order to perform updates with products Adobe MS Security E