JS help please: show/hide Radio button option

Hello community,

I'm not good with JS and need your help!

My client has 3 payment options (radio button):

  • Credit card (default selection with possibility to put any credit card info in "'paymentdiv ' tag div")
  • PayPal
  • Bank transfer (to choose the Bank of dorpdown in "bankpaymentdiv ' tag div)

The following code hides the option of credit card if the user chooses the option Paypal or bank transfer

function ShowCCFields(val) {

if (!document.getElementById('paymentdiv')) return; 

if (val != 1) document.getElementById('paymentdiv').style.display = 'none';

else document.getElementById('paymentdiv').style.display = 'inline';  

}

HOWEVER, if I select Paypal, it hides card banking option (as it should) - but not the payment of the Bank of field option. How do I get there?

This should do it:

paymentdiv

See you soon.

Tags: Business Catalyst

Similar Questions

  • With value of check box for show/hide radio buttons?

    I have created a pdf form. I have a checkbox and radio buttons several. I put it so radio buttons are hidden until the user clicks on the checkbox above him. I also put the box reset option on mouse-to top buttons. However, radio buttons are always selectable. I want to assure you that if one of the radio options is selected, the check box to be checked as well.

    Is there a bit of javascript, I could add to the check box to hide the option buttons if its value is not equal to yes (checked)?

    You can use code similar to

    If (event.target.value == 'Yes') {}
    selected - display radio buttons
    this.getField('Radio_Button1').display = display.visible; view the radio button
    } else {}
    Show box unchecked hide radio button and reset the field
    this.getField('Radio_Button1').display = display.hidden; Hide radio button
    this.resetForm (["Radio Button1'"]); Disable the option button
    }

    But YOY will have to change the field "Radio Button1" name match your fyouor domain name to the Group of radio buttons.

  • Show/hide the buttons of different page

    Hi all

    I was responsible for creating an interactive PDF of several page which is basically a questionnaire. Each page will have one question with the results of all issues gathered in a table at the end. Ideally, I would like to answer each question to send to a cell in a table but I can't find a way to get there, so my solution was to use radio buttons to select the buttons for results and responses. I had planned to assign an action show/hide radio buttons to reveal the answer on another page. During testing I ran into a problem when you configure the action show/hide, it allows me to select a show/hide button, unless its on the same page as the option button! Does anyone know if there is a solution to this? If someone can not advice me how I build such a feature?

    Thanks in advance,

    JS

    In Indesign, you will need to install the buttons in response to the same page as the radio buttons for the construction of all hide / display the activations. It's the only way you will be able to set these properties. Once you have completed and tested, you can now move the buttons in response to another page. Option buttons to activate hide/show buttons to answer to a different page. I have a test file that shows, if you want, I can send it to you.

  • Radio button / options PDF

    Hello

    I would like to access the PDF of a radio button options. My code.

    Alert (p.description);

    causes of this alert to display.

    Screen Shot 2015-09-21 at 12.13.01.png

    I expected to see "Hello."

    In fact, I need to know the, Description, selected by default and the value of the key.

    It is in InDesign CS6.

    Thank you.

    P.

    Hi Pickory

    I think the summary, it is that there is a bug in cs6 which means you can't do what you want, it's the same bug at the origin of the problem in the link I posted.

    This problem has been fixed at some point, this is why Peter didn't see the problem.

    The work around in the link won't help the less to no Boolean values level.

    In short, give up or write a plug-in

    Trevor

  • I have 3 radio button options to choose, but I want only a certain one for calculating sales tax. How can I assign a calculation to an option button?

    I have 3 radio button options to choose, but I want only a certain one for calculating sales tax. How can I assign a calculation to an option button?

    Ok. Let's say the name of the radio button group is "Radio1", the value of exports in this field is '3', the name of the subtotal is "Subtotal" and tax rate is 16%. You can use this code as the custom calculation of the tax field script:

    Event.Value = (this.getField("Radio1").valueAsString == "3")? Number (this.getField("Subtotal").valueAsString) * 0.16: 0;

  • simple ' show / hide ' script using option buttons, need a bit of help

    Hello;

    I have a place in my form I need to swap out what type of form you need to fill in an area. If I don't do it, it makes the page look over crowded, and if I go off to a process 2 or 3 steps, it doesn't have enough information in each section to be worth. It is one or the other.

    At the present time, this code works well. Click on a radio button, and the form section appears and disappears. What I'm trying to do when the page loads, one of the radio buttons is selected and one of the sections of the form is visible. Then if you click the other radio button, it inverts the.

    can someone help me tweek this code if one of the buttons is selected all the time?

    Here is my script.

    < style type = "text/css" >
    {.showHide}
    position: absolute;
    background-color: #f1f1f1;
    Width: 350px;
    padding: 1px;
    color: black;
    border: 2px #999999 wiped out;
    display: none;
    }
    < / style >


    < script language = "JavaScript" >
    function setVisibility (id, visibility) {}
    document.getElementById (id).style.display = visibility;
    }

    < /script >

    < form >

    < input name = type type = radio onclick = "setVisibility ('sub3', 'inline'); setVisibility('sub4','none');" value "male" = checked > selection 1 "

    < input type = radio type value = 'female' onclick = name = "setVisibility ('sub3', 'none'); setVisibility ('sub4', 'inline');"; > selection 2

    < div id = "sub3" class = "showHide" > selection 1 content < / div >

    < div id = "sub4" class = "showHide" > selection 2 content < / div >

    < / make >

    That's the short of it with tons of other codes on anyone of dumping.

    Thank you

    You took the class attributes of option buttons that corresponding with the functions of jquery... very simple fix. I have re-uploaded the sample page with your code and the class number fixed. Seems to work well. If you have other questions give me a shout. New page updated.

  • Show/hide multiple Button controls increment/decrement is AWOL

    As far as I can see (LV 2013), there is a missing feature in LabVIEW, whereby, when you select multiple digital controls, you can't show/hide their increment/decrement buttons:

    Here, I have 3 DBL, 1 I32 and 1 enum, but that goes for any combination of numeric values. If I right click on one of the selected controls, I have access to only two points in the title of the "visible Points":

    -Label

    -Legend

    Where is ' Increment/decrement' part, whereas it is common to all these controls?

    BUG? I couldn't find it mentioned elsewhere, but I would not be surprised to be the first to have noticed.


  • Remove all instances of a subform by a radio button option

    I have a radio button with Yes/No options.  If the user selects 'Yes', a group of questions and a button are rendered visible.  If the user wants to add another group of questions they must click on the button that has been done just visible.  The other group of issues is in a subform that again if the user clicks the button. If the user changes their mind 'Yes' to 'No', I need to have subforms that have been added deleted. How all instances of repeat the subform can be removed by selecting the option "?

    Yes radio button script:

    If (this.rawValue == 1) {}

    subform.presence = "visible";

    }

    The button script:

    _subform2.addInstance (1);

    Thank you!

    You can control the number of instances with the setInstances() method.

      // Remove all instances of subform2
    _subform2.setInstances(0);
    
  • Hotkeys to show/hide the tool Options and the Photo to PSE11 tray

    LOL - I just find it has shortened F4 to show/hide the xD Tool Options
    Overall I have disabled "Auto Show Tool Options" option and use F4... Thanks Adobe you have not left it without no solution!

    Title of the message was edited by: Brett N

    And have you tried F5? You will soon use the F4 and F5 to clear your display

  • Need help with AS3 on Radio button Quiz

    I am trying to set up a quiz question multiple choice of radio button, but I have problems with some of the ACE and hoped that some of you could help me. I'm fairly new to ActionScript, but I'm trying to pick up quickly. The code is listed below. The lines of errors have been increased in size.

    Import fl.controls.RadioButtonGroup;


    var radioGroup1:RadioButtonGroup = new RadioButtonGroup ("QuestionC1");

    var totalScore:int = 0;

    var totalCorrect:int = 0;

    var totalWrong:int = 0;


    cpr1a.label = "" Complete a resuscitation ";"

    cpr1b.label = "" cardio a resuscitation ";"

    cpr1c.label = "" cardio a Revival ";"

    cpr1d.label = "" Complete a Revival ";"


    cpr1a. Group = radioGroup1;

    cpr1b. Group = radioGroup1;

    cpr1c. Group = radioGroup1;

    cpr1d. Group = radioGroup1;


    submit_btn.addEventListener (MouseEvent.CLICK, submitClick);


    function submitClick (MouseEvent): void {}

    If (radioGroup1.selection == null) { }

    return;

    }

    If (radioGroup1.selection.label == "Cardio a resuscitation") { }

    status_txt.text is radioGroup1.selection.label + "is correct!";

    totalCorrect ++;

    score_txt.text = "Correct number:" + String (totalCorrect) + "\n"; "."

    score_txt.appendText ("wrong number:" + String (totalWrong));

    }else{

    status_txt.text is radioGroup1.selection.label + "is incorrect. I'm sorry. » ;

    totalWrong ++;

    score_txt.text = "Correct number:" + String (totalCorrect) + "\n"; "."

    score_txt.appendText ("wrong number:" + String (totalWrong));

    }

    }

    I don't see where this error could occur except perhaps for a case where a radio AS2 is used because it seems that they do not have a group property, but an AS3 radio button.  Make sure that your publication of Flash settings are set to use AS3.  AS3 errors normally have error numbers that also made the mistake that you mentioned ring of a scenario of AS2.

    Here is a link to the file that I made based on your code that works very well and does not display the errors you mention.  It is a CS3 file.

    http://www.nedwebs.com/Flash/AS3_Radios.fla

  • Show/hide the buttons on the tabular form region

    I have a classic tabular form with standard buttons: AddRows, RemoveSelectedRows, cancel, Save. What I want is to have the button visible to AddRows only when there is no given on the form (the source table is empty). When the user clicks the AddRows button, a blank line apears. Right now I want to show, save, and Cancel buttons (buttons remove is covered by the current Condition). And when the user deletes all the data in the table, I want to hide all buttons except AddRows.

    How to do this? Thanks in advance.

    Hello

    If you use Apex 3.x and you have created a table by using wizard, you already have branch page.
    Change this branch and add to the query field

    &REQUEST.
    

    BR, Jari

  • Radio buttons option requires inputText to fill

    I have a few radio buttons where people have 3 options. One of the options is to be rejected. If the rejection is chosen, I want an inputText on this page to become necessary so that the user cannot save his choice until he wrote a few comments in the inputText. My problem is that I Don t know how to catch the value of option buttons until I saved this value to the database. I would be grateful if someone could tell me how to do this.


    I got it to partly to work now. I have an ID assigned to radio buttons and use this id in the partialTriggers of the InputText component property and then set the required property to #{bindings. Status.inputValue is "Reject"}. In this way I have seem to be able to get the value in the option buttons until it is saved in the database. But the problem I have now is that if the user changes his mind and won't reject anyway and sets the option buttons to again accept the remains of InputText required instead of evolution not requires again as I thought he would do.

    Published by: Viking Atlantic on November 5, 2008 04:52

    Hello

    the immediate property of the 'true' radio button value and complete response of the FacesContext in order to avoid an update of the model. I would like to write the condition or not the textfield should be obliged by a managed bean variable. In this way is easier to change the value

    Frank

  • Need help with show/hide Div position

    WDRC project site

    I use a show/hide behavior with my menu items. If you mouseover all the links (except the home), you will see an image with some text appear below. The one shown in the right position is the "press room". The rest are falling down, based on their position within the Division 'description' how can I do each of their ascent to the proper position when their respective link is wriggling on?

    Thanks a lot for your senses! Problem solved.
    :-)

  • Show/hide bounding box option does not work. No more keyboard shortcuts. Also more problems.

    I had problems with the CC Illustrator who started this morning and I hope I can find a solution through this forum. I tried to contact adobe in appellant and chat support and I didn't know until today is how problems in their customer service program. I was transferred several times to the bad people while waiting for an hour each time, or is disconnected during a hold and had to start over my waiting time. Cat was not helpful because they don't answer my questions or give me a direct line to call, instead of repeating that I have contact the same telephone number that puts me on hold and then drop my calls (I use a land line).

    It is very difficult to describe the problem, but I'll do my best. I can't use the bounding box feature, even if the show bounding box option is selected. None of my shortcut keys work and all the files that I opened are unbearably slow. Everything I do in the program is hit or miss or not even happen, so in order to see the change, I have to scroll the artboard and return; that is, draw a rectangle (then has to scroll far off the screen to the Board chart and scroll back to see), fill it with a color (then have to scroll far and scroll back to see again), or changes do not occur at all (scroll away or not). Also sometimes Illustrator does not recognize my actions unless I repeat them several times.

    I use the software Adobe CC every day at my work (Illustrator, Photoshop, Indesign, After Effects) and have never had a problem like that. I have not download or change settings on my computer before it happened.  All my other adobe programs work well as are all other programs not adobe on my computer. All my programs are now fully updated and restarted my computer at least a dozen times. If anyone could shed some light on how I can solve this problem, or have worked in it before that I would appreciate greatly any assistance. I'm very behind on my work and have deadlines to hit. Thanks in advance for any help!

    Data sheet:

    iMac
    27 inch, mid-2011
    Processor: Intel Core i5 at 2.7 GHz

    Memory: 8 GB at 1333 MHz DDR3

    Graphics card: AMD Radeon HD 6770 M 512 MB

    Software: Mac OS X Lion 10.7.5 (11G63b)

    Traore,

    There is a possibility I thought, a little hidden in 5) and perhaps unlikely because it happened only today, namely the lack of having two families of fonts Verdana and Tahoma installed as TTF and activated; that caused some hesitation to Illy reported in the past.

    But it sounds a little weird than that.

  • Help, please: what is the button on the front (top) of the E3000 do.

    It's in the middle of the row of icons.

    It is the Wifi Protected Setup button. You can read more about it here.

Maybe you are looking for