Comments (7)
Please post your code here.
from angular-validation.
<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.
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.
`
<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.
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.
hmm.. my bad, do you want to make a plunkr or online editor so that we can run your code?
from angular-validation.
its only a part of code i can not share the whole code.
because its running project
from angular-validation.
Related Issues (20)
- Question: How to re-call validation on a single form input ? HOT 7
- npm 1.4.3 package contains file with no name - breaks install HOT 8
- How to set input invalid using controller HOT 3
- Why set webpack as dependencies? HOT 3
- 关于validation-group的疑问 HOT 1
- 如何将错误信息展示在一个容器中并只展示第一个错误的信息? HOT 2
- CheckValid not working as expected HOT 3
- Validators not updating when dependant on other form values HOT 2
- Need to Add equalTo validation as it's required and widely used too. HOT 3
- Required validation is invalid when model value is 0 HOT 2
- validation-submit not work in version1.4.x HOT 3
- I´m getting the error Possibly unhandled rejection: error HOT 3
- 720kb datepicker is not working when we include angular-validation inside it. HOT 5
- how can use with angular ui select HOT 3
- Why add the validator = "required" valid-method = "blur" tag, js can not get ng-model value? HOT 7
- Allow empty string for validator? HOT 1
- [Question] Is there anything similar to this library for Angular 4? HOT 1
- Clear Form after submit shows validation HOT 5
- dynamic elements added to scope does not validate HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-validation.