Select with the javascript function

I need to create a purchase order that allows to calculate the cost of printing using one-sided or two-sided. My problem is that this code can use only the cost of single_side in the function. The function must use two side cost if "DUP" checkbox is disabled. What I read javascript does not provide a way to access the selection list as if it were a table. (Where I can identify what dimension of the table I would use). Is there another way to do this?

< script type = "text/javascript" >
total() function
{
var Field1 = document.getElementById("DUP").value;
var Field2 = document.getElementById("COPIES").value;
var field3 = document.getElementById("ORIG").value;
Field4 var = document.form2.paperlist.value;
sphere5 var = document.form2.paperlist.value;
If (Field1! = "no")
document.getElementById("mytotal").value = parseInt (field2) *.
parseInt (field3) / 2 * parseFloat (field4);

on the other
document.getElementById("mytotal").value = parseInt (field2) *.
parseInt (field3) * parseFloat (field5);

}
< /script >

Select name = "paperlist" id = "paperlist" onchange = "total ()" > "
< cfoutput query = "paperlist" >
< option value = "#paperlist.single_side # #paperlist.two_side #" > #paperlist.descr #, #paperlist.single_side #, #paperlist.two_side # < / option >
< / cfoutput >
< / select >

< input type = "checkbox" name = "DUP" id = "DUP" onchange = "total ()" accesskey = "3" tabindex = "3" > "
< input type = "text" name = "COPIES" id = "COPIES" onchange = "total ()" accesskey = "1" tabindex = "1" default size "0" = "10" = > "
< input type = "text" name = "ORIG" id = "ORIG" onchange = "total ()" size = "10" accesskey = "2" tabindex = "2" default = "0" / > "
< input type = "text" name = "mytotal" id = "mytotal" readonly = "true" size = "10" / >
< input type = "submit" name = "submit" value = "Submit" / >

I guess you want to get the "selected" option from the selection list?

You call the js function in the onchange event of the select list just pass it as a parameter

Select name = "paperlist" id = "paperlist" onchange = "total (this.selectedIndex.value)" > "

total function (slectedValue)

or

document. FORMNAME. SELECTLISTNAME.options [document. FORMNAME. Alue SELECTLISTNAME.selectedIndex] .v

This will give you the value selected from the list of selection, simply replace "FORMNAME" with the name of your form and your 'SELECTLIST' with the name of your selection list

Ken

Edit:
Should have to read it again, yes you can do it.

It is not clear which character you have between 2 values in the value attribute of the selection list, but I would suggest a comma, no spaces

Then

field5Array = field5.split(',');

This will then give you the picture that you want with
field5Array [0] equal to single sided
and
field5Array [1] equal to double-sided

Tags: ColdFusion

Similar Questions

  • Can we synchronize permission selected with the settings of operating system Notifications BB10 for our Application.

    Steps to follow:
    BB10 device--> settings--> Notifications--> Applications--> [name of your application]--> all alerts [Toggle button]

    I have an obligation to check whether or not 'All alerts' is allowed through settings when the application is running. To check if we can synchronize permission selected with the settings of operating system Notifications BB10 for my application. How to get javascript code if alerts permission is on / off, while the application is running.

    I tried adding the blackberry.system function and tried to hasPermission (blackberry.push) also, I can't determine if permission is allow / prohibit... Please suggest how to get that.

    I don't see a WebWorks API for this. If I expected to be anywhere, it's here:
    https://developer.BlackBerry.com/HTML5/APIs/beta/BlackBerry.notification.html#jbo1385148829097

    But it seems that this API has not been fully implemented; It may be useful to connect a developer Issue Tracker JIRA to get this feature added.

    At the same time, there is this API of Cascades that looks like what you're looking for:
    https://developer.BlackBerry.com/native/reference/Cascades/bb__platform__notificationapplicationsett...

    Write an extension for this feature should allow you to access this feature:
    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10-Cordova/template

    At the same time, a colleague is currently working on an extension that should open many features of Qt, and I think that the API above should be accessible through this extension. He must be released over the next week or two, so you can wait for that as well.

    EDIT: On this last point, see this extension which provides a mechanism for attaching in the majority of the Qt APIs.

    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10-Cordova/QtBridge

  • Frame using Vector with the trace function

    Hi all

    When I convert a raster to vector with the trace function, the result is excellent but I want to reduce the number of points, so I have less layers when I import it to the painter. Can anyone advise how to do?

    Rayne

    RayneMaker,

    You can select everything on every layer, Ctrl/CmdClicking on the names of layers, Ctrl / Cmd + A and Ctrl / Cmd + C to copy the whole and then open a new document, deselect the layers of dough remembers in the layers flyout and Ctrl / Cmd + F to insert a single layer.

    I'm still with 10, and there may be more easy/more smart solutions (in later versions).

  • I need a little help with the INSTR function

    Hello everyone,

    im still new to pl sql and experienced an issue with the INSTR function. I need to analyze some values of a CLOB containing the xml code and use INSTR to determine the beginning and end of the value, I would like to analyze.

    the data I need is in a <!-[CDATA [[Some Text]]]-> block. up to this point, I managed to take the start of the word, but I can't seem to capture the end of the CDATA block. I use this statement:

    POS: = INSTR (TO_CHAR (input_clob) [,'] ', pos2 + 6, 1);

    but it doesn't have the desired effect. [It seems to sort of go back to the length of the string, while the]-sign is actually in the xml file. my result would look to "Some Text]]--> < xmlxml >... < / xmlxml >...» ». [I tried to escape by writing ' \] "but if I do, the function returns zero and my parsed string is left blank.

    Unfortunately I can't use regular expressions, because I work with oracle 9.2i. Anyone know what I'm doing wrong?

    Thank you

    Edited by: user8719779 the 25.08.2009 02:23
    with my_tab as (select ''||chr(10)||
                           '  '||chr(10)||
                           '   '||chr(10)||
                           '  '||chr(10)||
                           '' col1 from dual)
    -- end of mimicking your data; USE SQL below:
    select substr(col1, instr(col1, '', 1, 1) - instr(col1, 'Hello

    I am facing a problem with the GetParameter() function in IScript. I created a URL below and appellant IScript

    GenerateScriptContentURL ("EMPLOYEE", "MFC", Record.WEBLIB_REPT_SJ, Field.ISCRIPT1, "FieldFormula", "IScript_GetAttachment"). "? FileName =' | & AttachUserFileURL;

    before generating URLS, I'm just encrypt the name of the ZIP file & assignment in the variable string & AttachUserFileURL I concatenated in link above.

    and try to take the value encrypted text of decryption by %Request.GetParameter("FileName") in IScript who isn't able to get special characters such as +, is.

    Please get this.

    Thank you

    Edited by: 936729 may 25, 2012 03:35

    + and = are allowed in URLS. You just have to URL encode like this EncodeURLForQueryString(&AttachUserFileURL) before adding them to your URL:

    GenerateScriptContentURL("EMPLOYEE", "HRMS", Record.WEBLIB_REPT_SJ, Field.ISCRIPT1, "FieldFormula", "IScript_GetAttachment") | "?FileName=" | EncodeURLForQueryString(&AttachUserFileURL);
    

    Here is the entrance of PeopleBook for EncodeURLForQueryString:

    http://docs.Oracle.com/CD/E28394_01/pt852pbh1/Eng/psbooks/TPCL/htm/tpcl02.htm#_6453b1b1_1355ab71343__503e

  • White on white selection with the magic wand of refining

    I'm trying to remove the background of a picture of BW - one model posing in front of a white background.

    Select with the magic wand works fine except on the area where the light on the model wears the white skin. When I choose, I get the hand and the lower part of the arm (see below) but miss the box top, completely white. I tried all kinds of settings and also tried to increase the contrast with a brightness/contrast layer, but nothing I I understand allows me to keep the arm and remove the bottom with the arm.  FWIW, the image cannot be redone.

    How can I do? Thanks for any help.

    EdB

    fist copy.jpg

    Learn how masking... Also in white when mixed in a layer with the blending mode multiply does not change.  So, if you add a new layer on top of your image and set its blending mode to multiply. You will see your arm starts to show through. Add a maske layer to this layer and paint with black to show the lower arm of the layer by hiding the top layer on the arm area.

  • How to call the javascript function in ADF

    I have the javascript function stored in a .js file external (try to reuse in another application). How can call the javascript function for an event of ADF faces component. I need to I am a newbie to ADF, all ideas are appreciated.

    Kind regards
    Surya

    Published by: sgodavar on Sep 24, 2010 11:44

    Include JavaScript to the jsff/jspx as page:

    Call it like:

    Type = "dblClick" / >
    Amit

  • The JavaScript functionality is broken at Wells Fargo

    Since mid-June (may have started with 21 FF, but not sure), I was unable to transfer money between accounts at Wells Fargo.

    The web page contains Javascript, and you are supposed to choose an account 'to' drop down, then an account 'to' fall down, and then a new box will appear where you can type the amount.

    However, nothing happens after selecting my/from accounts.

    IE/Chrome do not have this problem.

    JavaScript is enabled in my browser and I tried to set all the options, but no luck.

    Any ideas?

    Start Firefox in Mode safe to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    To turn on safe mode

    • You can open Firefox 4.0 + in Safe Mode holding the key SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • Or open the Help menu and click on the restart with the disabled... modules menu item while Firefox is running.
    • Once you get the pop-up, simply select "" boot mode safe. "

    If it works in Mode safe mode and normal mode with all extensions (Tools > Modules > Extensions) off and then try to find which extension is the cause by allowing an extension at a time until the problem reappears.

    Close and restart Firefox after each change via "Firefox > Exit ' (Windows: Firefox/file > quit;) Mac: ' Firefox > quit Firefox. " Linux: "Firefox/file > exit ')

  • Use about Central button mouse to call the JavaScript function question

    I want to use the mouse middle button to call the function JavaScript (< a href = "javascript:help ()" >) help() opens a new window and directly to the Help Page of my GUI, but when I click on it with the middle button, it will open new tab blank Page that url = "javascript:help()"; " can't help executive function... What is a Firefox Bug or a correct behavior in Firefox? I thank.

    You must use left click to manage JavaScript links.

    See also http://kb.mozillazine.org/browser.link.open_newwindow.restriction

  • Disable the unwanted selection on the hover function

    Once again, my Lenovo Thinkpad 430 (running Windows 7) is constantly selecting what the pointer is sitting on. This happens regularly, and it drives me crazy. I was able to cure it in the past, but today I was unable to do so. The feature "Activate a window by hovering over it with a mouse" in Windows is NOT selected. Windows is configured to require a double click to open a window. Several times in the past, I have disabled the function of 'type' in the Lenovo touchpad (touchpad is the only pointer device that I use), but today I can't even find these settings to make sure that they are always disabled. I forget to do?

    I solved this. I installed a software update of the ultranav device, which allowed me to open the ultranav settings and change the settings again.

Maybe you are looking for