Selasa, 10 November 2020

Popup Submit

document.getElementById("btnsumbit").addEventListener("click",function(){
	$('#popup').modal('hide');
	$.post("?act=save",$(this.form).serialize()).done(function(response){
		console.log(response);
		if(response.split("<<<")[1]==" reload ")location.reload(true);
	});
	event.preventDefault();
});
          
fmtarget.querySelectorAll('input[type=text]').forEach(function(el){
	console.log(el.name);
	el.value='';
});

Rabu, 04 November 2020

Falidate Form

 function validateForm() {

var ct=0;

var inputs=document.getElementsByTagName("input");

for (i = 0; i < inputs.length; i++) {

try{

if(inputs[i].value == '' && inputs[i].title.toLowerCase() == 'penting') {

ct = 1;

inputs[i].style.background= "blue";

}

}catch(e){}

}

    if (ct != 0) {

        alert("Yang Berwarna kuning harus di isi");

        return false;

    }

}










x = document.querySelectorAll(".example");

  for (i = 0; i < x.length; i++) {

    x[i].style.backgroundColor = "red";

  }

Selasa, 03 November 2020

HTML Basic

 HTML Check Checked


dd

Foto Propades