У меня есть форма, которая имеет степенного мастера. Для работы stepy wizard необходимо использовать кнопку ввода отправки, а не кнопку. Так что я использую кнопку отправки, но при нажатии кнопки отправки она перенаправление на главную страницу. Мой кодAngularJS ajax form submit with submit input
<form action="#" id="wizard" class="form-horizontal" ng-submit="abc($event)">
<!-- Step 1 -->
<fieldset title="Step 1">
<legend>Registration</legend>
<div class="form-group">
<label for="" class="col-md-2 control-label"><?php echo $this->lang->line('label_house_number'); ?></label>
<div class="col-md-3"><input type="text" class="form-control" required="required" ng-model="newItem.housenumber"/></div>
<label for="" class="col-md-2 control-label"><?php echo $this->lang->line('label_house_name'); ?></label>
<div class="col-md-3"><input type="text" class="form-control" required="required" ng-model="newItem.housename"/></div>
</div>
</fieldset>
<fieldset title="Step 2">
<legend>Registration</legend>
<div class="form-group">
<label for="" class="col-md-2 control-label"><?php echo $this->lang->line('label_place'); ?></label>
<div class="col-md-3"><input type="text" class="form-control" required="required" ng-model="newItem.place"/></div>
<label for="" class="col-md-2 control-label"><?php echo $this->lang->line('label_land_mark'); ?></label>
<div class="col-md-3"><input type="text" class="form-control" ng-model="newItem.language"/></div>
</fieldset>
<fieldset title="Step 3">
<legend><?php echo $this->lang->line('label_fac'); ?></legend>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-6">
<label class="radio-inline">
<input type="checkbox" ng-model="newItem.electricity" value="electricity" /><?php echo $this->lang->line('label_electricty'); ?>
</label>
</div>
</div>
</fieldset>
<fieldset title="Step 4">
<legend>Agriculture</legend>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-6">
<label class="radio-inline">
<input type="checkbox" ng-model="newItem.cocunut" value="cocunut" /><?php echo $this->lang->line('label_cocunut'); ?>
</label>
</div>
</div>
</fieldset>
<fieldset title="Step 5">
<legend> Other</legend>
<div class="form-group">
<label for="" class="col-md-2 control-label"><?php echo $this->lang->line('label_get_any_help'); ?></label>
<div class="col-md-3"><input type="text" class="form-control" ng-model="newItem.help"/></div>
<label for="" class="col-md-2 control-label"><?php echo $this->lang->line('label_source'); ?></label>
<div class="col-md-3"><input type="text" class="form-control" ng-model="newItem.source"/></div>
</div>
</fieldset>
<input type="submit" class="finish btn-success btn" value="Submit"/>
</form>
и это мой контроллер
mahalPlus.controller('familyRegistrationController', function($scope) {
$scope.abc = function(event){
event.preventDefault();
alert('submitted');
};
});
Теперь форма не перенаправляется. Но предупреждение тоже не работает ..! Любая идея? –