Jump to content
php.lv forumi

Pievienošanas poga


airbus

Recommended Posts

Piemēram, šitā:

function check_all(){
if(document.getElementById('l1').value.length * document.getElementById('l2').value.length * document.getElementById('l3').value.length * document.getElementById('l4').value.length){
document.getElementById('p1').style.display = '';
}
else {
document.getElementById('p1').style.display = 'none';
}
}
...
<input id="l1" name="lauks1" type="text" onchange="check_all()">
<input id="l2" name="lauks2" type="text" onchange="check_all()">
<input id="l3" name="lauks3" type="text" onchange="check_all()">
<input id="l4" name="lauks4" type="text" onchange="check_all()">
<input id="p1" name="poga1" type="button" style="display : none">
...

Link to comment
Share on other sites

Airbus... Aber lūdzu:

<?php
echo <<< AIRBUS_4EWA
function check_all(){
if(document.getElementById('l1').value.length * document.getElementById('l2').value.length * document.getElementById('l3').value.length * document.getElementById('l4').value.length){
document.getElementById('p1').style.display = '';
}
else {
document.getElementById('p1').style.display = 'none';
}
}
...
<input id="l1" name="lauks1" type="text" onchange="check_all()">
<input id="l2" name="lauks2" type="text" onchange="check_all()">
<input id="l3" name="lauks3" type="text" onchange="check_all()">
<input id="l4" name="lauks4" type="text" onchange="check_all()">
<input id="p1" name="poga1" type="button" style="display : none">
...
AIRBUS_4EWA;
?>

Link to comment
Share on other sites

Vēl vari izmantot AJAX. Bet skaties, kurš risinājums ir ātrāks. Būtībā tas ir tikai dekoratīvs elements, jo iesniegt formu tāpat var - ar vai bez pogas - to ļoti vienkārši ir nokārtot. Jebkurā gadījumā visas nepieciešamās pārbaudes ir jāveic servera pusē. JavaScript tu vari vienkārši klientu ērtības labad un trafika atvieglošanai veikt pārbaudes...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...