Severity: 8192
Message: Return type of CI_Session_files_driver::open($save_path, $name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 113
Severity: 8192
Message: Return type of CI_Session_files_driver::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 280
Severity: 8192
Message: Return type of CI_Session_files_driver::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 145
Severity: 8192
Message: Return type of CI_Session_files_driver::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 223
Severity: 8192
Message: Return type of CI_Session_files_driver::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 303
Severity: 8192
Message: Return type of CI_Session_files_driver::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 344
Severity: 8192
Message: setcookie(): Passing null to parameter #7 ($httponly) of type bool is deprecated
Filename: core/Input.php
Line Number: 410
Bu yazıda Javascript ile form (üyelik formu vb.) doldurulunca önceden pasif olarak ayarladığımız submit butonunu aktifleştirmeyi öğreneceğiz. Bunu yaparken jQuery kodu değil sadece Javascript kodu kullanacağız. Bu işlem için 2 tane input, 1 tane checkbox ve 1 tane buton olan bir form oluşturalım. Butonu en başta disabled (pasif) olarak ayarlıyoruz. Formun bütün elemanlarını doldurduğumuzda pasif olan butonu aktifleştireceğiz. Bütün kodları aşağıda bulabilirsiniz. Not: Eğer sadece jQuery kodu ile aynı işlemi yapmak istiyorsanız bu yazıyı okuyabilirsiniz.
Oluşturulan Form
Javascript Kodu
function form_kontrol()
{
if(document.getElementById("ad").value.length == 0)
document.getElementById("gonder").disabled = true;
else if(document.getElementById("soyad").value.length == 0)
document.getElementById("gonder").disabled = true;
else if(document.getElementById("kosullar").checked == false)
document.getElementById("gonder").disabled = true;
else
document.getElementById("gonder").disabled = false;
}
HTML Kodu
<div id="uyelik_formu">
<form action="#" method="post">
<label>Adı:</label>
<input type="text" id="ad" name="ad" onkeyup="form_kontrol()">
<br><br>
<label>Soyadı:</label>
<input type="text" id="soyad" name="soyad" onkeyup="form_kontrol()">
<br><br>
<input type="checkbox" id="kosullar" name="kosullar" onchange="form_kontrol()">Kullanım koşullarını kabul ediyorum.
<br><br>
<button type="submit" id="gonder" disabled>Gönder</button>
</form>
</div>
CSS Kodu
#uyelik_formu
{
padding: 10px;
width: 350px;
border: 1px solid black;
}
label
{
float: left;
width: 150px;
}
YORUMLAR