Jak mógłbym zablokować proces wysyłania formularza dopóki nie wczytam zmiennych w inputy? Wiem że można w php, ale może ktoś zna sposób w javascript?
<a style='color:red' href="#" id = reg onclick="testowa()"> <b>Załaduj współrzędne markera!
</b> <form method="post" action="index.php?mod=add_woda"> Długość:
<input type="text" name="naz1" id="nazwa"/>Szerokość:
<input type="text" name="naz2" id="nazwa2"/><p align='center'><input type="submit" value="Dalej"/>
Coś jak:
<script type="text/javascript">
<!-- //
function regulamin()
{
if(document.getElementById('reg').checked == true )
{
document.getElementById('dalej').disabled=false;
}
else
{
document.getElementById('dalej').disabled=true;
}
}
// ]]> -->
</script>
<b><small>Oświadczam, że zapoznałem się z regulaminem i zgadzam się na warunki tam zamieszczone.
</small></b> <input type="checkbox" id="reg" onclick="regulamin()" /> <p align='center'><input style="font-weight: bold;" type="submit" name="submit" value="utwórz konto" id="dalej" disabled="disabled"></p>