cucumber Posted November 27, 2006 Report 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?
andrisp Posted November 27, 2006 Report Posted November 27, 2006 Man kautkā strādā (vismaz hidden input vērtība tiek uzstādīta) abos gadījumos.
Delfins Posted November 27, 2006 Report Posted November 27, 2006 Vispār jau pareizi ir: document.Forms.MyForm.HiddenField.value = my_value;
cucumber Posted November 27, 2006 Author Report 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
v3rb0 Posted November 27, 2006 Report 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.
andrisp Posted November 27, 2006 Report 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.
Val Posted November 27, 2006 Report 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>
Delfins Posted November 27, 2006 Report Posted November 27, 2006 Viss tur mainās... nevajag maldināt tautu... droši vien JS atslēgts.
andrisp Posted November 27, 2006 Report 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
cucumber Posted November 27, 2006 Author Report 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.
Delfins Posted November 27, 2006 Report 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)
andrisp Posted November 27, 2006 Report 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.
Recommended Posts