Autor Zpráva
cpbbt
Profil *
Zdravím,
mám nekolik formů a potřebuji při kliknutí odeslat všechny hodnoty a po odopovědi je zase všechny nastavit.
Ale nefunguje to. Hodnoty se nenajdou. Díky za rady.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">;
    <script src="jquery.js" type="text/javascript" charset="windows-1250"></script>
  <title></title>
  </head>
  <body>
  <script charset="windows-1250" type="text/javascript">
<!--
$(document).ready(function() { 
 $(':submit').click(function () {         
  var sys140a = $('input[name=sys140]'); 
  $('input[name=sys140]').val("");
  var sys141 = $('input[name=sys141]'); 
  $('input[name=sys141]').val("");
  var sys142 = $('input[name=sys142]'); 
  $('input[name=sys142]').val("");
  var sys143 = $('input[name=sys143]'); 
  $('input[name=sys143]').val("");
  var sys144 = $('input[name=sys144]'); 
  $('input[name=sys144]').val("");
  var sys145 = $('input[name=sys145]'); 
  $('input[name=sys145]').val("");
  var sys146 = $('input[name=sys146]'); 
  $('input[name=sys146]').val("");
  var sys147 = $('input[name=sys147]'); 
  $('input[name=sys147]').val("");
var data = 'sys140=' + sys140a.val()+'&sys141=' + sys141.val()+'&sys142=' + sys142.val()+'&sys143=' + sys143.val()+'&sys144=' + sys144.val()+'&sys145=' + sys145.val()+'&sys146=' + sys146.val()+'&sys147=' + sys147.val();  
alert(data);
 //start the ajax 
        $.ajax({ 
            //this is the php file that processes the data and send mail 
            url: "control.php",  
              
            //GET method is used 
            type: "GET", 
  
            //pass the data          
            data: data,      
            
            dataType: 'json',
            
            //Do not cache the page 
            cache: false, 
              
            //success 
            success: function (html) {               
                //if process.php returned 1/true (send mail success) 

                $('input[name=sys140]').val(html.sys140);
                $('input[name=sys141]').val(html.sys141);
                 $('input[name=sys142]').val(html.sys142);
                $('input[name=sys143]').val(html.sys143);
                 $('input[name=sys144]').val(html.sys144);
                $('input[name=sys145]').val(html.sys145);
                $('input[name=sys146]').val(html.sys146);
                $('input[name=sys147]').val(html.sys147);
            }        
        }); 
 return false;
});
});
//-->
</script>
   <div class="form"> 
      <form action="http://127.0.0.1/deska/d3.php" method="get">
                <br>Rele 1 <b>sys[140] </b> = 
                <input type="text" maxlength="16" name="sys140">&nbsp;&nbsp;
                <input class="submit" type="submit" value="set" onclick>
              </form>
      <form action="http://127.0.0.1/deska/d3.php" method="get">
                <br>Rele 1 <b>sys[141] </b> = 
                <input type="text" maxlength="16" name="sys141">&nbsp;&nbsp;
                <input class="submit" type="submit" value="set" onclick>
              </form>
                    <form action="http://127.0.0.1/deska/d3.php" method="get">
                <br>Rele 1 <b>sys[142] </b> = 
                <input type="text" maxlength="16" name="sys142">&nbsp;&nbsp;
                <input class="submit" type="submit" value="set" onclick>
              </form>
      <form action="http://127.0.0.1/deska/d3.php" method="get">
                <br>Rele 1 <b>sys[143] </b> = 
                <input type="text" maxlength="16" name="sys143">&nbsp;&nbsp;
                <input class="submit" type="submit" value="set" onclick>
              </form>
      <form action="http://127.0.0.1/deska/d3.php" method="get">
                <br>Rele 1 <b>sys[144] </b> = 
                <input type="text" maxlength="16" name="sys144">&nbsp;&nbsp;
                <input class="submit" type="submit" value="set" onclick>
              </form>
      <form action="http://127.0.0.1/deska/d3.php" method="get">
                <br>Rele 1 <b>sys[145] </b> = 
                <input type="text" maxlength="16" name="sys145">&nbsp;&nbsp;
                <input class="submit" type="submit" value="set" onclick>
              </form>
      <form action="http://127.0.0.1/deska/d3.php" method="get">
                <br>Rele 1 <b>sys[146] </b> = 
                <input type="text" maxlength="16" name="sys146">&nbsp;&nbsp;
                <input class="submit" type="submit" value="set" onclick>
              </form>
      <form action="http://127.0.0.1/deska/d3.php" method="get">
                <br>Rele 1 <b>sys[147] </b> = 
                <input type="text" maxlength="16" name="sys147">&nbsp;&nbsp;
                <input class="submit" type="submit" value="set" onclick>
              </form>
  </div>
  </body>
</html>

Darker
Profil
Nastavit na co? Skus víc psaát amíň kopírovat kódy...

Vaše odpověď

Mohlo by se hodit

Neumíte-li správně určit příčinu chyby, vkládejte odkazy na živé ukázky.
Užíváte-li nějakou cizí knihovnu, ukažte odpovídajícím, kde jste ji vzali.

Užitečné odkazy:

Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: