[PHP] Conditional Logic Forms
Results 1 to 8 of 8
  1. #1
    Senior Member Array
    Join Date
    Aug 2013
    Age
    21
    Karma
    7

    Question Conditional Logic Forms

    Da li neko moze da mi da najprostiji primer ove forme?
    Na primer neka bude checkbox sa DA i NE opcijom, ako se kline DA,
    izadje recmo textobox, pokusavam da nadjem na netu tutorijale za ovo
    ali sve sto mi izlazi su sajtovi koji nude neki svoj Form Builder
    CustomLearn: http://www.youtube.com/customlearn

    Map: 35hp_defer
    Download: GameBanana, 17Buddies

    Map: Aim_Rushers
    Download: GameBanana, 17Buddies

  2. #2
    Member Array
    Join Date
    Feb 2016
    Karma
    2

    Default

    <form action="" method="post">
    <input type="radio" name="da" value="Da">Da
    <input type="radio" name="ne" value="Ne">Ne
    <input type="submit" name="submit" value="Submit" />
    </form>
    <?php
    if (isset($_POST['submit'])) {
    if(isset($_POST['da']))
    {
    echo "Odabrali ste :".$_POST['da'];
    }
    }
    ?>

  3. #3
    Moderator Array Megastorm's Avatar
    Join Date
    Sep 2011
    Location
    Tokyo, Japan
    Age
    22
    Karma
    32

    Default

    Quote Originally Posted by Vaki# View Post
    <form action="" method="post">
    <input type="radio" name="da" value="Da">Da
    <input type="radio" name="ne" value="Ne">Ne
    <input type="submit" name="submit" value="Submit" />
    </form>
    <?php
    if (isset($_POST['submit'])) {
    if(isset($_POST['da']))
    {
    echo "Odabrali ste :".$_POST['da'];
    }
    }
    ?>
    Trazio je verovatno JavaScript varijantu, jer koliko vidim hoce da mu se nesto prikaze na klik, ne da se ispise posle prosledjivanja forme.

  4. #4
    Moderator Array klipica's Avatar
    Join Date
    Apr 2010
    Location
    lk-net.com
    Karma
    26

    Default

    U slucaju JS, Angular je vrh za takve stvari.
    Code:
    #YoMama {
        width: 200%;
        overflow: visible;
    }

  5. #5
    Senior Member Array
    Join Date
    Apr 2011
    Location
    The Great Slavistania
    Age
    19
    Karma
    19

    Default

    Quote Originally Posted by klipica View Post
    U slucaju JS, Angular je vrh za takve stvari.

    Vue.js nije los isto
    Last edited by milutinke2; 28-05-2017 at 20:51.

  6. #6
    Senior Member Array
    Join Date
    Aug 2013
    Age
    21
    Karma
    7

    Default

    Da, kao sto je megastorm rekao, treba mi da kad neko klikne izadje mu taj tekst, ali kad se vrati na ne opet sakrije se tekst,
    to mi treba cisto zbog primera da bih video kako funkcionise pa da ja posle malo proguglam i prostudiran da bih napravio neku prostu formu
    CustomLearn: http://www.youtube.com/customlearn

    Map: 35hp_defer
    Download: GameBanana, 17Buddies

    Map: Aim_Rushers
    Download: GameBanana, 17Buddies

  7. #7
    Moderator Array klipica's Avatar
    Join Date
    Apr 2010
    Location
    lk-net.com
    Karma
    26

    Default

    Resenje sa Angular.js:
    Code:
    <!DOCTYPE html>
    <html ng-app="Application">
        <head>
            <title>Conditional Logic</title>
    
            <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
        </head>
        <body>
            <div ng-controller="RadioController">
                <form>
                    <label for="radio_da">DA</label>
                    <input id="radio_da" type="radio" ng-model="showDiv" ng-value="true"/>
                    <br/>
                    <label for="radio_ne">NE</label>
                    <input id="radio_ne" type="radio" ng-model="showDiv" ng-value="false"/>
                </form>
    
                <div ng-show="showDiv">
                    <p>Ovaj tekst ce se pokazati ako je otkaceno DA.</p>
                </div>
            </div>
    
            <script>
                angular.module('Application', [])
                    .controller('RadioController', ['$scope', function($scope) {
                        $scope.showDiv = true;
                    }]);
            </script>
        </body>
    </html>
    Code:
    #YoMama {
        width: 200%;
        overflow: visible;
    }

  8. #8
    Senior Member Array
    Join Date
    Aug 2013
    Age
    21
    Karma
    7

    Default

    Quote Originally Posted by klipica View Post
    Resenje sa Angular.js:
    Code:
    <!DOCTYPE html>
    <html ng-app="Application">
        <head>
            <title>Conditional Logic</title>
    
            <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
        </head>
        <body>
            <div ng-controller="RadioController">
                <form>
                    <label for="radio_da">DA</label>
                    <input id="radio_da" type="radio" ng-model="showDiv" ng-value="true"/>
                    <br/>
                    <label for="radio_ne">NE</label>
                    <input id="radio_ne" type="radio" ng-model="showDiv" ng-value="false"/>
                </form>
    
                <div ng-show="showDiv">
                    <p>Ovaj tekst ce se pokazati ako je otkaceno DA.</p>
                </div>
            </div>
    
            <script>
                angular.module('Application', [])
                    .controller('RadioController', ['$scope', function($scope) {
                        $scope.showDiv = true;
                    }]);
            </script>
        </body>
    </html>
    To je to, hvala
    CustomLearn: http://www.youtube.com/customlearn

    Map: 35hp_defer
    Download: GameBanana, 17Buddies

    Map: Aim_Rushers
    Download: GameBanana, 17Buddies

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •