javascript - PHP. How to correctly check the empty form field or not? -


there form sending application. default fields required. how organize check filled in field or not , output of alerts in case of empty value, no reset of filled fields. it's this: if @ least 1 field not filled, form updated , fields have been filled reset. please modify else's code((

<script> $(document).ready(function(){    ....      var soparray_<?=$_request['code']?> = [ //массив сопоставлений         {orig: ".bids_form_<?=$_request['code']?> #namework_<?=$_request['code']?>", now: "property[name][0]"},         {orig: ".bids_form_<?=$_request['code']?> #datestart_<?=$_request['code']?>", now: "property[date_active_from][0]"},         {orig: ".bids_form_<?=$_request['code']?> #dateend_<?=$_request['code']?>", now: "property[date_active_to][0]"},         {orig: ".bids_form_<?=$_request['code']?> #laborinput_<?=$_request['code']?>", now: "property[18][0]"},         {orig: ".bids_form_<?=$_request['code']?> #workduration_<?=$_request['code']?>", now: "property[19][0]"},         {orig: ".bids_form_<?=$_request['code']?> #developmenttime_<?=$_request['code']?>", now: "property[20][0]"},     ];      (index = 0; index < soparray_<?=$_request['code']?>.length; ++index) {         $(soparray_<?=$_request['code']?>[index].orig).val($(".form_id_<?=$_request['code']?> input[name='" + soparray_<?=$_request['code']?>[index].now + "']").val());     }     <?if(strpos($application->getcurdir(), '/bids/') === false ):?>        if ($('#namework_<?=$_request['code']?>').val()) {         $('#set-view-bid').html('<b>Просмотреть заявку<b>');     }     <?endif;?>      $(" div.btn_submit_form_<?=$_request['code']?>").on('click', function(){         var formid = $(this).attr('formid');          $('.files-box_<?=$_request['code']?>').append($('.bids_form_<?=$_request['code']?> .files-block').detach());         (index = 0; index < soparray_<?=$_request['code']?>.length; ++index) {             // alert(soparray[index].orig + ' - ' + soparray[index].now);             $('.form_id_'+formid).find("input[name='" + soparray_<?=$_request['code']?>[index].now + "']").val($(soparray_<?=$_request['code']?>[index].orig).val());         }         $('.form_id_'+formid).find("input[type='submit']").click();     }); }) 

thoughts this:

$(window).scrolltop(0);             if ($("#namework_<?=$_request['code']?>").val() != '') $('#erridlogin').hide();             if ($("#datestart_<?=$_request['code']?>").val() != '') $('#erridpassword').hide();             if ($("#dateend_<?=$_request['code']?>").val() != '') $('#erridconfirm_password').hide();             if ($("#laborinput_<?=$_request['code']?>").val() != '') $('#erridemail').hide();         } else {             $("#form-button").click();         }     }); 


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -