Modification of radio button JavaScript

Hi all

OK so I have a form that has both select the drop-down list of the buttons and option buttons. Some have an amount applied to each ' price/value' choices and some have just a list of options, the options that have a value/price also calculate and give a "grand total" amount that appears at the bottom of the form. Once the form completed and submitted all the information is then sent to an email BUT the tricky bit is, on items that do both, to calculate and give a choice, I want only the possibility to be sent to the email, not the price, but I want to calculate. The large amount total is displayed at the bottom is the only amount that was to be sent to the email.

For example, I broke it down to an element of the form as illustrated.

HTML

< select name = "CAT_Custom_76927" id = "CAT_Custom_76927" class = "sΘlectionner" onchange = "Recalculate ()" >

< option selected = "selected" value = "0" > - options select Limousine - < / option >

< option value = "" 0 #1 "> 1 (free, except with the coffin of base) < / option >"

< option value = "#2 250" > 2 (& pound; 250) < / option >

< option value = "#3 500" > 3 (& pound; 500) < / option >

< option value = "750 #4" > 4 (& pound; 750) < / option >

< / select >

JavaScript

Grand_Total 1810.00 = + parseFloat ($("#CAT_Custom_76927 option:selected").val()); )

document.catwebformform22057.Grand_Total.value = grand_total.toFixed (2);

php action page

$CAT_Custom_76927 = explode (' #', $_POST ['CAT_Custom_76927']);

$grand_total = $_POST ["grand_total"];

$email_body. = "no Limos: $CAT_Custom_76927 [1].» \n » ;

$email_body. = ' funeral total cost: $ £grand_total. ". \n » ;

As seen on the email

N ° Limousines: 4.

Total cost of funeral: £2560.

As you can see, 4 limousines have been selected and calculated in "grand total" but only the chosen option was displayed in the email. It works perfectly, but the problem I have is that only works for selected lists. I don't know what I have to do to run the option button? Currently this is from the amount.

Can someone help me with this please? Here is the link to the corresponding page to get a code in its entirety.

http://www.clockdoctors.co.UK/test/arrangement-form.html

Having watched this you would deal with radio buttons the same way as any other element. (The index is that you already use radio buttons for the choice of coffin)

Suppose you want to ask the customer how much 'personal funeral they need in the presence' for the funeral for example:

You must include the price of values for the button radio/quanity - 100 #10, 200 #20, 300 #30 as below:

Staff of funeral in the presence

10 (£100)

20 (200 pounds)

30 (300 pounds)

You would then add that to the grand_total - function Recalculate()

+ parseFloat (GetSelectedItem (document.catwebformform22057.CAT_Custom_007))

Then in the php process form script add the variable to get the number of the value of the radio button:

$CAT_Custom_007 = explode (' #', $_POST ['CAT_Custom_007']);

$email_body. = ' present personal funeral: $CAT_Custom_007 [1].» \n » ;

I think it should work.

Tags: Dreamweaver

Similar Questions

  • modification of radio button when...

    Hello

    I'm changing the "enabled" radio button when the user type a text in a cfinput (priority)
    and when they select an option other than the one with the value cfselect ""
    or let the first checked radio button.

    Here is my code "does not.


    < script language = "JavaScript" >
    <!--
    function Radio_Auto_switch()
    {
    frm var = document.getElementById ('givdonf');
    var Desgobj = frm.designation;
    var FacDesgSelVal is frm. Faculty_designation. Value;
    var DesgOthrtext = frm.desgother.value;

    If (DesgOthrtext! = "")
    {
    Desgobj [1] checked = false;
    Desgobj [2] checked = false;
    Desgobj [3] checked = true;

    If (FacDesgSelVal! = "" "")
    {
    Desgobj [1] checked = false;
    Desgobj [2] checked = true;
    Desgobj [3] checked = false;
    }
    on the other
    {
    Desgobj [1] checked = true;
    Desgobj [2] checked = false;
    Desgobj [3] checked = false;
    }
    }
    }
    ->
    < /script >

    < action = "TestEndofTransaction.cfm cfform" id = "givdonf" name = "givdonf" onSubmit = "return Val_select_type();" > "
    < table >
    < b >
    < td width = "15" height = "28" align = "center" valign = "top" class = "formtext" >
    < name cfinput = "name" type = "radio" value = "greatest needs 1T311Concordia" required = "yes".
    message = 'Please sΘlectionner information designation' checked = "true" > < table >
    < td colspan = "4" valign = "top" class = "formtext" > < span class = "advform" > greater need of Concordia University </span > < table >
    < /tr >
    < b >
    < height td = "28" align = "center" valign = "top" class = "formtext" > < span class = "formtext" >
    < input name = "name" type = "radio" value = "Fund 2Specific" >
    </span > < table >
    < td width = "115" valign = "top" class = "formtext" > < span class = "advform" > specific fund: </span > < table >
    < td colspan = "3" valign = "top" > < cfselect class = "formtext" style = "" width: 370px "name ="Faculty_designation"onMouseUp =" Radio_Auto_switch () ">"
    "< option value =" "selected ="selected"> select... < / option >"
    < option value = "T302Faculty of Arts and Science" > Faculty of Arts and sciences < / option >
    < option value = "T304Faculty of Engineering and Computer Science" > Faculty of Engineering and Computer Science < / option >
    < option value = "T305Faculty of Fine Arts" > Faculty of Fine Arts < / option >
    < option value = "T324General scholarships and scholarships - undergraduate" > General grants & scholarships - program undergraduate < / option >
    < option value = 'T325General scholarships and bursaries' - graduate > program of General scholarships & Awards - graduate < / option >
    < option value = "T358JMSB new building Fund" > new JMSB building fund < / option >
    < option value = 'T303John Molson School of Business' > John Molson School of Business < / option >
    < option value = "T309Libraries" > libraries < / option >
    < option value = "Refectory restaurant H158Loyola" > restoration of the Loyola refectory < / option >
    < option value = 'T310Recreation & Athletics' > leisure & Athletics < / option >
    < option value = "T507Shuffle" > Shuffle 2007 < / option >
    < option value = 'T321Sir George William Initiatives' > Initiatives of Sir George William < / option >
    < / cfselect > < table >
    < /tr >
    < b >
    < height td = "26" align = "center" valign = "top" class = "formtext" >
    < name cfinput = "name" type = "radio" value = "3Specific stock or Fund" > < table >
    < td valign = "top" class = "formtext" nowrap > < span class = "advform" > specific scholarships or funds: </span > < table >
    < td colspan = "3" valign = "top" >
    < name cfinput = "desgother" type = "text" class = "formtext" id = "desgother" size = "38".
    validate = "maxlength" maxlength = "60" onKeyUp = 'return Radio_Auto_switch()' > < table >
    < /tr >
    < /table >
    < / cfform >

    Someone has an idea of what does not work?

    Thank you
    Chantal

    Found my problem...

    The index of the object of the radio starts at zero (0), not one (1).
    Who was "plant my javascript.

    Should have been

    Desgobj [0] checked = false;
    Desgobj [1] checked = false;
    Desgobj [2] checked = true;

    I hope this helps someone!

  • radio button javascript alert

    I use the code below for form validation

    var x is return ["form2"] ["weeks"] .value;.

    If ("x == null | x ==" ")

    {

    Alert ("duration must be checked");

    Returns false;

    }

    but the weeks is actually the radio buttons

    < input type = "radio" value = "364" name = 'weeks' / >

    < input type = "radio" value = "301" name = 'weeks' / >

    How to convert the code above works with a radio button

    Thank you

    in advance

    They have demos on their website which should give you a complete overview.

    You can also download the file source here: http://jquery.bassistance.de/validate/jquery-validation-1.9.0.zip

    This kit includes demos, CSS, JS and all files associated with. They should help you get started.

  • FormCalc or Javascript for the radio buttons?

    I need to write a script that uses radio buttons.

    If a radiobutton is selected (my radiobuttion is called rbJanuary) then textbox1 = textbox2.

    How I write this and it's in FormCalc or Javascript? Thank you!

    Hello

    It doesn't matter what language you use for your request, it will work in both while FormCalc has a thinner syntax.

    FormCalc:

    if ($ eq 1) then
              Textfield1 = Textfield2
    else
              Textfield1 = ""
    endif
    

    JavaScript:

    if (this.rawValue === "1") {
              Textfield1.rawValue = Textfield2.rawValue;
    } else {
              Textfield1.rawValue = "";
    }
    
  • Hide the button label Radio via Javascript

    Aloah,

    I have a problem with the cache one option button and label.

    Location:

    I have two groups of Radio with 3 radio buttons.
    Click on a radio button within the first group, I would like to hide the 2 buttons in the second.

    I tried the x_ToggleItem of javascript functions, the x_Hide and the x_ToggleItemRow.
    But all the functions to do the same thing:
    They hide only the button (input type), but not the label (not the Label of the Radio group, but the radio button label).

    So my question is:
    How to hide the button Radio WITH his label?
    Or: How I address the label in JavaScript?

    PS: in the future I will bore you guys more often with questions: P

    MFG,
    Andi

    Hello Andi,

    The problem is that the current implementation of the input element radio group and the label are "separated". There is no common parent (as it should be IMHO).

    But there is... jQuery. Using jQuery you can hide an element with the id and hide the label using the next() method.

    If something like this (where P13_RG1_3 is the 3rd option in a radiogroup):

    $('#P13_RG1_3').hide (); $('#P13_RG1_3').next () .hide ();

    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this response in marking it as useful or Correct ;-)

  • Modification of several radio buttons to a different group

    I have a pretty big shape based on the print that I need to turn it into a form online. I already have a PDF of the document and I just want to add radio buttons on top of the boxes existing. Each question had three possible answers (Yes, no, n/a), and of course I need to put each group of 3 checkboxes in the same group to make sure that they behave as expected and only allow one option by question.

    For the speed, I called the three checkboxes, gave them the right answers and the same group name, then duplicated them between the shape of alt - dragging them.

    I now need to go through the form and change the group names so that they are grouped by issue, rather than being part of the same group.

    i.e.

    The first group is P2_Q1. I want to choose the next group of three radio buttons in a single operation, and change their group to, say, P2_Q2. Then change the next group of three at P2_Q3, P2_Q4 and so on...

    I don't want not to change the name of each option button group, partly because I have a lot of questions, but also partly because that forced to do suggest Acrobat violates every principle of sound mind and good software design, Acrobat already makes my head ache like it is.

    Can anyone help? Thanks in advance.

    Screen Shot 2016-10-01 at 16.53.31.png

    Better start to rename, there is no way around it.

    I rarely use radio buttons, but when I do a large number of groups such as this (usually groups of checkboxes) I use a custom tool I built which allows me to quickly create fields. If although there is not a good integrated solution, it is possible to build a.

  • Currently can not find out how to add radio buttons to this javascript to make it work on them also.

    I am trying to add radio buttons to the if statement so that they are highlighted when not clicked aswell

    Thank you very much

    var emptyFields = [];

    var completedFields = [];

    for (var i = 0; i < this.numFields; i ++) {}

    var f = this.getField (this.getNthFieldName (i));

    v var = this.getField (this.getNthFieldName (i));

    If (f.type! = "button" & & f.required ") {}

    f.strokeColor = color.black;

    f.fillColor = color.white;

    If ((f.type=="text" & & f.value== "") |) (f.type == "checkbox" & & f.value == "Off"). (v.Value=="")) {

    emptyFields.push (f.name);

    f.strokeColor = color.red;

    f.fillColor = color.white;

    }

    }

    }

    If (emptyFields.length > 0) {}

    App.Alert ("error! You must fill in all the mandatory fields (highlighted in red)");

    }

    Try the following. I removed some superfluous things and formatted for readability.

    var emptyFields = [];

    for (var i = 0; i)< numfields;="" i++)="">

    var f = getField (getNthFieldName (i));

    If (f.type! = "button" & f.required) {}

    f.strokeColor = color.black;

    If)

    (f.type == 'text' & f.valueAsString == "")

    || (f.type == "checkbox" & f.valueAsString == 'Off')

    || (f.type == "radiobutton" & f.valueAsString == 'Off')

    || (f.type == "combobox" && f.valueAsString == "")) {

    emptyFields.push (f.name);

    f.strokeColor = color.red;

    }

    }

    }

    If (emptyFields.length > 0) {}

    App.Alert ("error! You must fill in all the mandatory fields (highlighted in red)");

    }

  • 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")

  • The use of JavaScript with radio buttons selected to assign a variable a value

    Hey everyone, a little new in Java and try to create a form for my work to request leave.  My problem is that I'm trying to assign a variable a value if the user clicks on a radio button or another.  Currently, they are incompatible with the following information:

    Name: Radio

    ToolTip: choice

    Button Style: check

    Radio button choice: Yes (this is the value of exports, that I think that I'm not sure how to use it correctly)

    nor is checked by default, but if a box is checked, I would have a variable defined on the "Approved" text, and if the other radio button is checked I would define the variable contains "disapprove".

    Here is my code now and thanks in advance for all the help:

    var S_auth;

    function auth() {}

    If (Radio.value == 'Yes') {}

    var S_auth = "approved";

    }

    else {}

    var S_auth = 'denied ';

    }

    }

    var employees = this.getField("Emp_Name").value;

    Supervisor of var = this.getField("Supervisor").value;

    var Leave_Type = this.getField("Dropdown2").value;

    var cToAddr = [email protected];

    var cCCADDr = this.getField("Email").value;

    var cBenAddr = this.getField("Sup_Email").value; If (cBenAddr! = "") cCCADDr += ';' + cBenAddr;

    var cSubline = "Re: leave request form for" + "" + employee + ', ' + Leave_Type + ', Status: "+ S_auth;"

    cbody var is 'your request for leave was' + S_auth + 'by' + supervisor. \n' + 'save the attachment of e-mail for your records. \n » ;

    this.mailDoc({)

    bUI: true,

    cTo: cToAddr,.

    cCc: cCCAddr,.

    bassujetti: cSubLine,

    CMSG: cbody

    });

    I honestly just want to have the subject line and the body to be able to show approved or disapproved according to which radio button, the project manager chooses.

    Yes, your script is now correct and should work.

  • Select a radio button via javascript

    Is it possible to select an option button using a script?

    I'm trying to select a radio button with the 0 value in a group called Department if a radio button with a value of 0 is selected in a group called TimeofCall.

    I tried this and several variants:

    If

    ((this. TimeofCall.rawValue == 0))

    {

    xfa.host.messageBox ("day is selected.");

    This. Department.rawValue

    == 0;

    }

    I get the message, so I know he checks the TimeofCall group but I can't seem to select an option button in the Group of Department.

    Any ideas would be appreciated.

    -Kevin

    You are the syntax is a little messed up.

    'This' is used to refer to the current object.

    Thus, assuming that the value you are testing is the current focus of basic education should be along the lines of:

    If (this.rawValue == 0) {}

    RadioButtonList.fieldname.rawValue = 0;

    }

    else {}

    //}

    If you test another area, it would be:

    If (fieldname.rawValue == 0) {}

    RadioButtonList.fieldname.rawValue = 0;

    }

    else {}

    //}

    Hope that helps! Going from memory for the moment...

  • Change the background fill color based on Radio button selections

    Hello

    I am very new script in LC, so I hit a wall on my last form. I am creating a form with a scale of 'leikert-like', however one of the stipulations (from my boss) is in this context of buttons are to be filled based radio which button is selected.

    For example, Question 1 has 4 radio buttons to choose: poor, fair, good, great. If the person completing the form selects poor, I wish the poor to fill background color. If someone chooses right, I would like to than this background color to be filled, as well as the background of the poor. Good selection would fill the colors of good, fair and poor; and selecting the big would fill the four colors.

    Someone has ideas of how / if possible? In my first tests, I got the button itself to change the colors, but not the background fill (which can be changed manually on the border palette).

    Any ideas would be much appreciated. Thank you!

    Aaron

    Here is the code that you can use in the event of modification of the ExclusionGroup (title default RadioButtonList) object. It is the parent of each individual option button object.

    for (var i=0;i
    

    This also assumes that the value of each option button is sequentially numbered from 1 to however many boxes option you have.

    Now, here's the thing. I'm assuming that each radio button has a different color. You might code for the colors yourself in JavaScript, but I manually chose the colors through UI Designers. Once all the colors of radio buttons have been defined, select a radio button and go see > XML Source. Where we see the element, add the presence of the attribute = "hidden". Do this for each option button. Here's what I mean:

                      
                      
                         
                          
                            
                         
                      
                      
    

    Kyle

  • Radio buttons Sub

    I have an interactive form where the user requests a leave of absence and selects one of the 6 reasons.

    Maternity

    Medical

    Model of the worker

    Family

    Military

    Personal

    If the user selects the family, there are two secondary reasons:

    Serious illness

    Related to childhood

    I did these two a group of radio buttons and the top level of the reasons a separate radio button group. Is it possible to nest a group in another? I found this code .xdp in the http://eslifeline.wordpress.com/2008/05/24/creating-nested-radio-buttons/

    Form1. #subform [0]. Continents. Africa::change - (JavaScript, client)
    Asia var = xfa.resolveNode ("form1. #subform [0]. Continents.Asia");
    Africa var = xfa.resolveNode ("form1. #subform [0]. Continents.Africa");
    europe var = xfa.resolveNode ("form1. #subform [0]. Continents.Europe");
    Kenya var = xfa.resolveNode ("form1. #subform [0]. Continents.Kenya");
    the Egypt var = xfa.resolveNode ("form1. #subform [0]. Continents.Egypt");
    the India var = xfa.resolveNode ("form1. #subform [0]. Continents.India");
    China var = xfa.resolveNode ("form1. #subform [0]. Continents.China");
    var other = xfa.resolveNode ("form1. #subform [0]. Continents.Other");
    explain var = xfa.resolveNode ("form1. #subform [0]. Explain");
    Asia.y = 89 + "points";
    Europe.y = 119 + "points";
    Other.y = 149 + "points";
    Asia.x = 'in 1.25 ";
    Africa.x = 'in 1.25 ";
    Europe.x = xPosition.value;
    Kenya.x = childXPosition.value;
    Egypt.x = childXPosition.value;
    Kenya.Presence = "visible";
    Egypt.Presence = "visible";
    Kenya.y = 45 + "points"
    Egypt.y = 60 + "points";
    India.Presence = 'hidden ';
    China.Presence = 'hidden ';
    EXPLAIN. Presence = "hidden";

    I have modifed for my form like this

    hide the child and the illness until the family is clicked
    does not work

    Var family = xfa.resolveNode ("LOA. Form1.reason.family");
    var child = xfa.resolveNode ("LOA. Form1.reason.child");
    Var disease = xfa.resolveNode ("LOA. Form1.reason.illness");

    Child.Presence = 'hidden ';
    Illness.Presence = 'hidden ';

    Family.y = 0.25 + "inches"; "
    Child.y = + 0.625 "inches"; "
    Illness.y = + 0.625 "inches"; "
    Child.x = childXPosition.value;
    Illness.x = childXPosition.value;

    Child.y = + 5.25 "inches" "
    Illness.y = 5.0 + "inches"; "


    LOA. Form1.reason.family::ready:form - (JavaScript, client)

    Utilities.resetPositions ();

    I would be very happy to help or suggestions to make the service of this code.

    Email to [email protected]

    Paul

  • Deactivation / activation of the Radio buttons

    Hi all

    I develop application in Oracle Application Express 5.0.0.00.31.

    In my page, I created a tabular form by using the query

    SELECT

    "ROWID",.

    'EMPNO ',.

    'ENAME ',.

    'STATUS ',.

    "ACCEPT."

    FROM "EMP".

    STATUS and ACCEPT two columns are type of radio button with a static query as

    STATUS: STATIC2: new; N, entitled; A, completed; D

    ACCEPT: STATIC2: accept; F, rework; R

    My requirement is

    1. When STATUS =has ' this time then ACCEPT column boxes must be activated. (I)

    2. another in('N','A') of STATUS then ACCEPT column buttons Radio must be turned off

    Note: Later I hide status column. Accept that column must be specified. Based on the value of the STATE Accept column column

    Radio buttons work

    I put my sample application in

    https://Apex.Oracle.com/pls/Apex/f?p=28020

    workspace: myspace77

    user: comments

    password: apex_demo

    -What someone will help me in this regard?

    Thanks in advance.

    Kind regards

    Colette

    Hi Colette.

    Check your Application-> Page 1 28020. I've implemented the toggle the radio button.

    Here are the steps to accomplish the toggling the buttons in table form:

    • Added STATUS column with alias STATUSD in the form of your table.
    • Added real action "Run the Code JavaScript" in your dynamic action "updating of the form: turn radio buttons:

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $('th#STATUSD').hide();
    $('td[headers="STATUSD"]').hide();
    $('td[headers="STATUSD"]').each(function() {
        var row_val = $(this).text();
        var row = $(this).closest('tr');
        if (row_val == 'N' || row_val == 'A') {
          row.find('td[headers="ACCEPT"] input[type="radio"]').attr("disabled", true);
        } else {
          row.find('td[headers="ACCEPT"] input[type="radio"]').removeAttr("disabled");
        }
    });
    

    Assigned items: no

    Kind regards

    Kiran

  • Assign values of radio button

    I am building a form with several option buttons.  The form is based on a Likert scale (of strongly in agreement to disagree strongly).  I would like to assign numerical values to each option button.  In many cases, values are 1, 2, 3, 4 and 5.  However, in some cases the statements are reverse scored only 5, 4, 3, 2 and 1.  The test also 10 scales ranging from 'My good Score' "my bad Score.  I have traced where each group of 5 boxes made (what scale).  Each scale is added, resulting in different scores 10 out of 10 different behaviors.

    I searched the net to determine how to do this, because I have already created a more straightforward test using the checkboxes; However, checkboxes properties provide an export value, while radio buttons are not.  So, I'm lost.

    I read about the grouping of option buttons so that only one can be selected.  Got that.  I even read 'export the value of the radio button' which does not exist.  More recently, I read on the scripts.  Enter Javascript!  I don't know anything about.

    Help, please.

    Radio-buttons have a value of exports. It is called 'Radio button choice' and can be found under Properties - Options.

  • Disable certain value in the Radio button group

    Hello

    Is it possible to have a group of radio buttons but have certain values with disabilities while they are displayed but cannot be selected while other values in the Group of radio buttons are selectable.

    I know that I could have two groups of radio next to each one showing the selectable values and another next to it showing disabled values but I'd rather have a radio group so that the values are in order.

    We currently use apex 4.2.5.00.08

    Thanks in advance

    where to enjoy a group of radio buttons with three values

    Yes, no, both

    so it's the two of us, without deactivation function

    -on your condition

    real action in dynamic action

    run javascript

    $("#P2_CHOOSE_STATUS_"+0).attr ("disabled", true);

    $("#P2_CHOOSE_STATUS_"+1).attr ("disabled", true);

    P2_CHOOSE_STATUS IS THE NAME OF THE ELEMENT

Maybe you are looking for