added validation for delivery destination
This commit is contained in:
@@ -5,7 +5,8 @@ var React = require('react'),
|
||||
NavigationActions = require('../../actions/navigationActions'),
|
||||
SingleItem = require('../items/singleItem'),
|
||||
Globals = require('../../globals'),
|
||||
CartTotal = require('./cartTotal');
|
||||
CartTotal = require('./cartTotal'),
|
||||
RibicaFormError = require('../shared/ribicaFormError');
|
||||
|
||||
|
||||
var Router = require('react-router');
|
||||
@@ -21,8 +22,10 @@ var CheckoutPage = React.createClass({
|
||||
<fieldset>
|
||||
<legend>Dostava</legend>
|
||||
<div className="form-group">
|
||||
|
||||
<label className="col-md-4 control-label" htmlFor="name">Prezime i Ime</label>
|
||||
<div className="col-md-4">
|
||||
<RibicaFormError componentName="name" errorMessagesObject={this.state.deliveryDestinationErrors} />
|
||||
<input id="name" name="name" type="text" placeholder="Prezime Ime" className="form-control input-md" required="" value={this.state.deliveryDestination.get('name')} onChange={this._onFieldChange} />
|
||||
<span className="help-block">ime osobe koja prima pošiljku</span>
|
||||
</div>
|
||||
@@ -30,6 +33,7 @@ var CheckoutPage = React.createClass({
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="name">Adresa</label>
|
||||
<div className="col-md-4">
|
||||
<RibicaFormError componentName="address" errorMessagesObject={this.state.deliveryDestinationErrors} />
|
||||
<input id="address" name="address" type="text" placeholder="Ulica i broj" className="form-control input-md" required="" value={this.state.deliveryDestination.get('address')} onChange={this._onFieldChange} />
|
||||
<span className="help-block">adresa na koju će roba biti isporučena</span>
|
||||
</div>
|
||||
@@ -38,6 +42,7 @@ var CheckoutPage = React.createClass({
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="place">Mjesto</label>
|
||||
<div className="col-md-4">
|
||||
<RibicaFormError componentName="place" errorMessagesObject={this.state.deliveryDestinationErrors} />
|
||||
<select id="place" name="place" className="form-control" value={this.state.deliveryDestination.get('place')} onChange={this._onFieldChange} >
|
||||
<option value=" 71000">Sarajevo</option>
|
||||
<option value=" 71103">Sarajevo, Centar</option>
|
||||
@@ -66,7 +71,7 @@ var CheckoutPage = React.createClass({
|
||||
<option value="76204">Bijela</option>
|
||||
<option value="76300">Bijeljina</option>
|
||||
<option value="73263">Bijelo Brdo</option>
|
||||
<option value="89230">Bileca</option> ++++++++
|
||||
<option value="89230">Bileca</option>
|
||||
<option value="72248">Biljesevo</option>
|
||||
<option value="88407">Bjelimici</option>
|
||||
<option value="88201">Blagaj</option>
|
||||
@@ -569,6 +574,7 @@ var CheckoutPage = React.createClass({
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="phone">Telefon</label>
|
||||
<div className="col-md-4">
|
||||
<RibicaFormError componentName="phone" errorMessagesObject={this.state.deliveryDestinationErrors} />
|
||||
<div className="input-group">
|
||||
<span className="input-group-addon">06</span>
|
||||
<input id="phone" name="phone" className="form-control" placeholder="1 222 333" type="text" required="" value={this.state.deliveryDestination.get('phone')} onChange={this._onFieldChange} />
|
||||
@@ -579,6 +585,7 @@ var CheckoutPage = React.createClass({
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="email">E - mail</label>
|
||||
<div className="col-md-4">
|
||||
<RibicaFormError componentName="email" errorMessagesObject={this.state.deliveryDestinationErrors} />
|
||||
<input id="email" name="email" type="text" placeholder="ime@nekimail.com" className="form-control input-md" required="" value={this.state.deliveryDestination.get('email')} onChange={this._onFieldChange} />
|
||||
<span className="help-block">E - mail adresa na koju će vam biti poslano obavještenje o narudžbi</span>
|
||||
</div>
|
||||
@@ -592,7 +599,7 @@ var CheckoutPage = React.createClass({
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="order"></label>
|
||||
<div className="col-md-8">
|
||||
<CartTotal items={this.state.items} itemCounts={this.state.itemCounts} /> <button id="order" name="order" className="btn btn-success" onClick={this._onOrderClick}>Naruči</button>
|
||||
<CartTotal items={this.state.items} itemCounts={this.state.itemCounts} /> <button id="order" name="order" className="btn btn-success" disabled={!this.state.isDeliveryDestinationValid} onClick={this._onOrderClick}>Naruči</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
Reference in New Issue
Block a user