Solved

How do I determine with radio button is selected and display html accordingly?

Posted on 2016-08-25
3
57 Views
Last Modified: 2016-09-01
I am trying to implement a different modal view that depends on which radio button is working.  But, the below code is not working correctly.  How am I implementing the radio buttons and the usage incorrectly?

<div class="modal-header">
        <input id="treeRadio" name="treeRadio" type="radio" checked="checked" ng-model="hMode" ng-value="tree" />
        <label for="treeRadio">Tree Mode</label>
        <input id="searchRadio" name="treeRadio" type="radio" ng-model="hMode" ng-value="search" />
        <label for="searchRadio">Search Mode</label>
        <input id="bookmarkRadio" name="treeRadio" type="radio" ng-model="hMode" ng-value="bookmark" />
                 <label for="bookmarkRadio">Search Mode</label>
    </div>
    <!--Tree Mode-->
    <div class="modal-open" style="height: 450px; overflow-y: auto;" ng-if="hMode=='tree'">
               <!--do stuff-->
    </div>
    <!--Search Mode-->
    <div class="modal-open" ng-if="hMode=='search'">
              <!--do stuff-->
    </div>
    <!--Bookmark Mode-->
    <div class="modal-open" ng-if="hMode=='bookmark'">
               <!--do stuff-->
    </div>
0
Comment
Question by:spazjr01
  • 2
3 Comments
 
LVL 54

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 41770970
Change ng-value to value - ng-value is usually used in an ng-repeat to dynamically populate a value attribute.
0
 

Author Closing Comment

by:spazjr01
ID: 41780742
Thanks.  Works perfectly per answer given.
0
 
LVL 54

Expert Comment

by:Julian Hansen
ID: 41780769
You are welcome.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question