cucumber Posted November 27, 2006 Report Share Posted November 27, 2006 <html> <body> <script type="text/javascript"> <!-- var c=-1; function byid(id) { if (document.getElementById) return (document.getElementById(id)); if (document.all) return document.all[id]; if (document.layers) return document.layers[id]; return false; } function move(dir) { if (dir==1) if(c!=0) c=c-1; if (dir==0) if(c!=2) c=c+1; if (byid('hid')) byid('hid').value= c; document.getElementById('txt').innerHTML= c; // document.MyForm.hid.value = c; //nestrada ???? // document.getElementById("hid").value = c; //nestrada ???? } //--> </script> <form name="MyForm" id="MyForm"> <input type="button" value="Back" onclick="move(1)"> <input type="button" value="Next" onclick="move(0)"><br /> <input id="hid" type="hidden" name="hid" value="0"> <span id="txt"></span> </form> </body> </html> Nesanak nomainit hidden vertibu,kur varetu but problema? Link to comment Share on other sites More sharing options...
andrisp Posted November 27, 2006 Report Share Posted November 27, 2006 Man kautkā strādā (vismaz hidden input vērtība tiek uzstādīta) abos gadījumos. Link to comment Share on other sites More sharing options...
Delfins Posted November 27, 2006 Report Share Posted November 27, 2006 Vispār jau pareizi ir: document.Forms.MyForm.HiddenField.value = my_value; Link to comment Share on other sites More sharing options...
cucumber Posted November 27, 2006 Author Report Share Posted November 27, 2006 (edited) man uz IE 6, nekas nemainas, skatos caur viewsource <html> <body> <script type="text/javascript"> <!-- var c=0; function move(dir) { if (dir==1) if(c!=0) c=c-1; if (dir==0) if(c!=2) c=c+1; document.getElementById('txt').innerHTML= c; document.MyForm.hid.value = c; } //--> </script> <?php echo $_GET['hid'] ?> <form name="MyForm" id="MyForm"> <input type="button" value="Back" onclick="move(1)"> <input type="button" value="Next" onclick="move(0)"><br /> <input id="hid" type="hidden" name="hid" value="0"> <span id="txt"></span> <input type="submit" value="go" name="but"> </form> </body> </html> Sanak ka view source spiezot nemainas, toties kad submito formu, vertibu nomaina? Edited November 27, 2006 by cucumber Link to comment Share on other sites More sharing options...
v3rb0 Posted November 27, 2006 Report Share Posted November 27, 2006 iekš view sorce šaubos vai kaut kas rādīsies.. nomaini type="hidden" pret type="text" un tad skaties vai mainīsies. Link to comment Share on other sites More sharing options...
andrisp Posted November 27, 2006 Report Share Posted November 27, 2006 Tur tu neko neredzēsi. View Source nerāda dinamiski ģenerēto markapu. Es nezinu kā ir ar IE, bet FF webdev toolbar piedāvā apskatīt ģenerēto sourci. Link to comment Share on other sites More sharing options...
Val Posted November 27, 2006 Report Share Posted November 27, 2006 Pamēģini šitam pamainīt hidden vērtību un tad submit'ot formu <html> <body> <?php print_r($_POST); ?> <script type="text/javascript"> <!-- var c=-1; function byid(id) { if (document.getElementById) return (document.getElementById(id)); if (document.all) return document.all[id]; if (document.layers) return document.layers[id]; return false; } function move(dir) { if (dir==1) if(c!=0) c=c-1; if (dir==0) if(c!=2) c=c+1; if (byid('hid')) byid('hid').value= c; document.getElementById('txt').innerHTML= c; // document.MyForm.hid.value = c; //nestrada ???? // document.getElementById("hid").value = c; //nestrada ???? } //--> </script> <form name="MyForm" id="MyForm" method="post"> <input type="button" value="Back" onclick="move(1)"> <input type="button" value="Next" onclick="move(0)"><br /> <input id="hid" type="hidden" name="hid" value="0"> <input type="submit" name="submit" /> <span id="txt"></span> </form> </body> </html> Link to comment Share on other sites More sharing options...
Delfins Posted November 27, 2006 Report Share Posted November 27, 2006 Viss tur mainās... nevajag maldināt tautu... droši vien JS atslēgts. Link to comment Share on other sites More sharing options...
andrisp Posted November 27, 2006 Report Share Posted November 27, 2006 (edited) Laikam jau noskaidrojām, ka cucumber vienkārši domāja, ka iekš IE View Source varēs redzēt izmaiņas. Edited November 27, 2006 by andrisp Link to comment Share on other sites More sharing options...
cucumber Posted November 27, 2006 Author Report Share Posted November 27, 2006 Laikam jau noskaidrojām, ka cucumber vienkārši domāja, ka iekš IE View Source varēs redzēt izmaiņas. Tieshi ta. Viss strada. Paldies. Link to comment Share on other sites More sharing options...
Delfins Posted November 27, 2006 Report Share Posted November 27, 2006 bugege. gada topiks! PS: ja gribi redzēt vērtības izmanto DOM Explorer (uz FF gan tikai, moš i IE ir) Link to comment Share on other sites More sharing options...
Stopp Posted November 27, 2006 Report Share Posted November 27, 2006 Vai arī View Selection Source. Link to comment Share on other sites More sharing options...
andrisp Posted November 27, 2006 Report Share Posted November 27, 2006 Delfins, paskatījos IE webdev tūlbārī. Tur tādu lietu nepiedāvā (apskatīt reālo DOM). Bet gan jau ir citi tūļi priekš IE, kas to dara. Link to comment Share on other sites More sharing options...
Recommended Posts