Giter Club home page Giter Club logo

Comments (7)

hueitan avatar hueitan commented on May 25, 2024

Please post your code here.

from angular-validation.

gauravBrain avatar gauravBrain commented on May 25, 2024
Personal
ADD IMAGE
<textarea class="form-control" placeholder="Body" ng-model="$ctrl.itemContent.body" validator="required"></textarea>
              <datepicker date-format="yyyy-MM-dd" selector="form-control">
                    <div class="form-group">
                      <input type="text" class="form-control" placeholder="DATE"  ng-model="$ctrl.itemContent.date">
                    </div>
              </datepicker>

              <div class="form-group">
                <input type="text" class="form-control" moment-picker="$ctrl.itemContent.getTime" format="HH:mm:ss" placeholder="TIME" ng-model="$ctrl.itemContent.getTime" validator="required">
              </div>

              <div class="form-group">
                <input type="text" class="form-control" placeholder="Address" ng-model="$ctrl.itemContent.address" validator="required">
              </div>
              
              <ul class="pop-tab">
                <li ng-class="{'active' : ($ctrl.activeTab == 'time')}"><a ng-click="$ctrl.changeTab('time')">Time</a></li>
                <li ng-class="{'active' : ($ctrl.activeTab == 'location')}"><a ng-click="$ctrl.changeTab('location')">Location</a></li>
              </ul>
              <!--pop-tab-->

              <div class="poptab-content">
                <div ng-if="$ctrl.activeTab == 'time'" class="tab_content" id="time">
                  <div class="form-group">
                    <div class="row">
                      <div class="col-md-6">
                          <datepicker date-format="yyyy-MM-dd" selector="form-control" >
                          <input type="text" class="form-control" placeholder="Date start" ng-model="$ctrl.itemContent.dateStart">
                          </datepicker>
                      </div>

                      <div class="col-md-6">
                        <input type="text" class="form-control" moment-picker="$ctrl.itemContent.getTimeStart" format="HH:mm:ss" placeholder="TIME START" ng-model="$ctrl.itemContent.getTimeStart" validator="required">
                      </div>
                    </div>
                  </div>
                  <div class="form-group">
                    <div class="row">
                      <div class="col-md-6">
                        <datepicker date-format="yyyy-MM-dd" selector="form-control" >
                          <input type="text" class="form-control" placeholder="Date end" ng-model="$ctrl.itemContent.dateEnd">
                        </datepicker>
                      </div>
                      <div class="col-md-6">
                        <input type="text" class="form-control" moment-picker="$ctrl.itemContent.getTimeEnd" format="HH:mm:ss" placeholder="TIME END" ng-model="$ctrl.itemContent.getTimeEnd" validator="required">
                      </div>
                    </div>
                  </div>
                  <div class="form-group">
                    <div class="row">
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="Price" ng-model="$ctrl.itemContent.price" validator="required">
                      </div>
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="Quantity" ng-model="$ctrl.itemContent.quantity" validator="required,Number">
                      </div>
                    </div>
                  </div>
                </div>
                
                <div ng-if="$ctrl.activeTab == 'location'" id="location" class="tab_content">
                  <div class="form-group">
                    <div class="row">
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="ADDRESS" ng-model="$ctrl.itemContent.address" validator="required">
                      </div>
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="CITY" ng-model="$ctrl.itemContent.city" validator="required">
                      </div>
                    </div>
                  </div>
                  <div class="form-group">
                    <div class="row">
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="PROVINCE" ng-model="$ctrl.itemContent.province" validator="required">
                      </div>
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="COUNTRY" ng-model="$ctrl.itemContent.country" validator="required">
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <!--poptab-content-->
              
              <div class="form-group">
                <div class="row">
                  <div class="col-md-6">
                    <div class="form-group"> <span class="share-title">Sync Item 
                      2 way</span>
                      <div class="share-radio">
                        <input type="checkbox" id="radio2">
                        <label for="radio2"></label>
                      </div>
                      <!--share-radio-->
                      <div style="clear: both;"></div>
                    </div>
                  </div>
                  <div class="col-md-6">
                    <div class="form-group"> <span class="share-title">Share on
                      showcase</span>
                      <div class="share-radio">
                        <input type="checkbox" id="radio3" ng-click="$ctrl.itemCheck()" ng-checked="true">
                        <label for="radio3"></label>
                      </div>
                      <!--share-radio-->
                      <div style="clear: both;"></div>
                    </div>
                  </div>
                </div>
              </div>
              <button type="submit" ng-click="$ctrl.addItem(itemForm)" class="custom-btn">Create</button>
            </form>
          </div>
      </div>

from angular-validation.

gauravBrain avatar gauravBrain commented on May 25, 2024

and validate it using

$validation.validate(form)
.success(function() {

        var items = $ctrl.itemContent;

        if($ctrl.modalData.userData.subscription_name == 'FREE'){
            items.time = items.getTime._d;
            if(document.getElementById("radio").checked == true){
                items.shareonShowcase = 1;
            }else{
                items.shareonShowcase = 0;
            } ;
        } 


        if($ctrl.modalData.userData.subscription_name == 'PERSONAL'){ 
            if(document.getElementById("radio2").checked == true){
                items.syncItem = 1;
            } else{
                items.syncItem = 0;
            } ;

            if(document.getElementById("radio3").checked == true){
                items.shareonShowcase = 1;
            }else{
                items.shareonShowcase = 0;
            } ;

            items.time = items.getTime._d;
            items.timeStart = items.getTimeStart._d;
            items.timeEnd = items.getTimeEnd._d;

        }
        
        if($ctrl.modalData.userData.subscription_name == 'PROFESSIONAL'){ 
             if(document.getElementById("radio4").checked == true){
                items.shareonShowcase = 1;
            }else{
                items.shareonShowcase = 0;
            } ;

            if(document.getElementById("radio5").checked == true){
                items.liveItem = 1;
            }else{
                items.liveItem = 0;
            } ;
            
            items.time = items.getTime._d;
        }  



         
        $ctrl.modalData.modalAction(items);
        $uibModalInstance.close();

    })  
    .error(function(){
                alert('invalid form input');
            });  

  };

from angular-validation.

gauravBrain avatar gauravBrain commented on May 25, 2024

`




Personal

ADD IMAGE









<textarea class="form-control" placeholder="Body" ng-model="$ctrl.itemContent.body" validator="required"></textarea>



              <datepicker date-format="yyyy-MM-dd" selector="form-control">
                    <div class="form-group">
                      <input type="text" class="form-control" placeholder="DATE"  ng-model="$ctrl.itemContent.date">
                    </div>
              </datepicker>

              <div class="form-group">
                <input type="text" class="form-control" moment-picker="$ctrl.itemContent.getTime" format="HH:mm:ss" placeholder="TIME" ng-model="$ctrl.itemContent.getTime" validator="required">
              </div>

              <div class="form-group">
                <input type="text" class="form-control" placeholder="Address" ng-model="$ctrl.itemContent.address" validator="required">
              </div>
              
              <ul class="pop-tab">
                <li ng-class="{'active' : ($ctrl.activeTab == 'time')}"><a ng-click="$ctrl.changeTab('time')">Time</a></li>
                <li ng-class="{'active' : ($ctrl.activeTab == 'location')}"><a ng-click="$ctrl.changeTab('location')">Location</a></li>
              </ul>
              <!--pop-tab-->

              <div class="poptab-content">
                <div ng-if="$ctrl.activeTab == 'time'" class="tab_content" id="time">
                  <div class="form-group">
                    <div class="row">
                      <div class="col-md-6">
                          <datepicker date-format="yyyy-MM-dd" selector="form-control" >
                          <input type="text" class="form-control" placeholder="Date start" ng-model="$ctrl.itemContent.dateStart">
                          </datepicker>
                      </div>

                      <div class="col-md-6">
                        <input type="text" class="form-control" moment-picker="$ctrl.itemContent.getTimeStart" format="HH:mm:ss" placeholder="TIME START" ng-model="$ctrl.itemContent.getTimeStart" validator="required">
                      </div>
                    </div>
                  </div>
                  <div class="form-group">
                    <div class="row">
                      <div class="col-md-6">
                        <datepicker date-format="yyyy-MM-dd" selector="form-control" >
                          <input type="text" class="form-control" placeholder="Date end" ng-model="$ctrl.itemContent.dateEnd">
                        </datepicker>
                      </div>
                      <div class="col-md-6">
                        <input type="text" class="form-control" moment-picker="$ctrl.itemContent.getTimeEnd" format="HH:mm:ss" placeholder="TIME END" ng-model="$ctrl.itemContent.getTimeEnd" validator="required">
                      </div>
                    </div>
                  </div>
                  <div class="form-group">
                    <div class="row">
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="Price" ng-model="$ctrl.itemContent.price" validator="required">
                      </div>
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="Quantity" ng-model="$ctrl.itemContent.quantity" validator="required,Number">
                      </div>
                    </div>
                  </div>
                </div>
                
                <div ng-if="$ctrl.activeTab == 'location'" id="location" class="tab_content">
                  <div class="form-group">
                    <div class="row">
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="ADDRESS" ng-model="$ctrl.itemContent.address" validator="required">
                      </div>
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="CITY" ng-model="$ctrl.itemContent.city" validator="required">
                      </div>
                    </div>
                  </div>
                  <div class="form-group">
                    <div class="row">
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="PROVINCE" ng-model="$ctrl.itemContent.province" validator="required">
                      </div>
                      <div class="col-md-6">
                        <input type="text" class="form-control" placeholder="COUNTRY" ng-model="$ctrl.itemContent.country" validator="required">
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <!--poptab-content-->
              
              <div class="form-group">
                <div class="row">
                  <div class="col-md-6">
                    <div class="form-group"> <span class="share-title">Sync Item 
                      2 way</span>
                      <div class="share-radio">
                        <input type="checkbox" id="radio2">
                        <label for="radio2"></label>
                      </div>
                      <!--share-radio-->
                      <div style="clear: both;"></div>
                    </div>
                  </div>
                  <div class="col-md-6">
                    <div class="form-group"> <span class="share-title">Share on
                      showcase</span>
                      <div class="share-radio">
                        <input type="checkbox" id="radio3" ng-click="$ctrl.itemCheck()" ng-checked="true">
                        <label for="radio3"></label>
                      </div>
                      <!--share-radio-->
                      <div style="clear: both;"></div>
                    </div>
                  </div>
                </div>
              </div>
              <button type="submit" ng-click="$ctrl.addItem(itemForm)" class="custom-btn">Create</button>
            </form>
          </div>
      </div>`

from angular-validation.

gauravBrain avatar gauravBrain commented on May 25, 2024

the code above text area is

<div class="modal-content"> <div class="modal-header"> <div class="user"><img src="{{ 'image//popup-user.png' | createImagePath }}" alt=""></div> <span class="info-title">Personal</span> <div class="row"> <div class="col-md-12"> <div class="add-image pull-right"><span>ADD IMAGE</span><input type="file" class="imgInp" /></div> </div> </div> </div> <div class="modal-body"> <form name="itemForm"> <div class="form-group"> <input type="text" class="form-control" placeholder="Title" ng-model="$ctrl.itemContent.title" validator="required"> </div> <div class="form-group">

from angular-validation.

hueitan avatar hueitan commented on May 25, 2024

hmm.. my bad, do you want to make a plunkr or online editor so that we can run your code?

from angular-validation.

gauravBrain avatar gauravBrain commented on May 25, 2024

its only a part of code i can not share the whole code.
because its running project

from angular-validation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.