Here is the process going on. I have a form. I want to make the registration process after I make the required check of this form. I tried many methods but I could not... ......
function KontrolForm(){
if(document.formInsert.search_new_places.value == ""){
window.alert("Alanı Boş Bırakmayın");
return false;
}else {
$('#btn_save').click(function(){
var place = $.trim($('#n_place').val());
var description = $.trim($('#n_description').val());
var kayitliyer = $.trim($('#search_new_places').val());
var yetkiliad = $.trim($('#n_yetkiliad').val());
var magazaad = $.trim($('#n_magazaad').val());
var telefon = $.trim($('#n_telefon').val());
var yetkilitelefon = $.trim($('#y_telefon').val());
var derece = $.trim($('#derece').val());
var country = $.trim($('#country').val());
var lat = $.trim($('#lat').val());
var long = $.trim($('#long').val());
// var lat = homeMarker.getPosition().lat();
//var lng = homeMarker.getPosition().lng();
$.post('save_place.php', {'place' : place, 'description' : description, 'lat' : lat, 'long' : long, 'kayitliyer' : kayitliyer, 'yetkiliad' : yetkiliad, 'magazaad' : magazaad, 'telefon' : telefon,'yetkilitelefon' : yetkilitelefon, 'derece' : derece, 'country': country},
function(data){
var place_id = data;
var new_option = $('<option>').attr({'data-id' : place_id, 'data-place' : place, 'data-lat' : lat, 'data-lng' : long, 'data-description' : description, 'data-kayitliyer' : kayitliyer, 'data-yetkiliad' : yetkiliad, 'data-magazaad' : magazaad, 'data-telefon' : telefon,'data-yetkilitelefon': yetkilitelefon,'data-derece' : derece, 'data-country' : country}).text(place);
new_option.appendTo($('#saved_places'));
}
);
$('input[type=text], input[type=hidden]').val('');
});
}
return true;
}
<div class="form-group">
<input type="submit" onsubmit="return KontrolForm()" class="btn btn-success btn-block" id="btn_save" value="Kaydet" />
</div>
Aucun commentaire:
Enregistrer un commentaire