trinklins Posted March 19, 2004 Report Share Posted March 19, 2004 <script LANGUAGE="JavaScript"> function press() { if (forma.poga.value == "ir") { forma.poga.value = "nav";} else { forma.poga.value = "ir";} } </SCRIPT> <form name="forma" method="post" action="<? echo $PHP_SELF?>"> <input type = 'submit' name = 'poga' value='ir' onclick = press()> </form> fiška tāda kautkas neiet :rolleyes: . Nu labi vajag tādu funkciju kas mainītu pogas value atkarībā no tās value. tas ir ja pogas value = "ir"tad nospiežot to pašu pogu tai vērtībai vajadzētu nomainītos uz "nav". Link to comment Share on other sites More sharing options...
Kaklz Posted March 19, 2004 Report Share Posted March 19, 2004 <script LANGUAGE="JavaScript"> function press() { if (forma.poga.value == "ir") { forma.poga.value = "nav";} else { forma.poga.value = "ir";} } </SCRIPT> <form name="forma" method="post"> <input type = "button" name = "poga" value="ir" onclick = "press()" /> </form> Iekš HTML nav tādas lietas kā parasto pēdiņu ;) pieņemsim, ka tev formu nevajag submitot, jo savādāk pie formas submita viņš pārlādē lapu un atkal uzliek tev pogas vērtību uz "ir" Link to comment Share on other sites More sharing options...
trinklins Posted March 19, 2004 Author Report Share Posted March 19, 2004 labais, kaut kādas smirdīgas kļūdas Link to comment Share on other sites More sharing options...
trinklins Posted April 1, 2004 Author Report Share Posted April 1, 2004 (edited) <script LANGUAGE="JavaScript"> function press(poga) { if (forma.poga.value == "ir") { forma.poga.value = "nav";} else { forma.poga.value = "ir";} } </SCRIPT> <form name="forma" method="post"> <input type = "button" name = "poga" value="ir" onclick = "press(poga1)" /> </form> tagad visu sho pasakumu vajadzeetu padariit universaalaaku respektiivi funkcijai tiek padota podota veertiiba poga1 un taa tiek apstraadaata funkcijas kermenii p.s. nu neemaaku to javascriptu Edited April 1, 2004 by trinklins Link to comment Share on other sites More sharing options...
Aleksejs Posted April 1, 2004 Report Share Posted April 1, 2004 Šitā? <script LANGUAGE="JavaScript"> function press(poga) { if (poga.value == "ir") { poga.value = "nav";} else { poga.value = "ir";} } </SCRIPT> <form name="forma" method="post"> <input type = "button" name = "poga1" value="ir" onclick = "press(this)" /> <input type = "button" name = "poga2" value="ir" onclick = "press(this)" /> <input type = "button" name = "poga3" value="ir" onclick = "press(this)" /> <input type = "button" name = "poga4" value="ir" onclick = "press(this)" /> <input type = "button" name = "poga5" value="ir" onclick = "press(this)" /> </form> Link to comment Share on other sites More sharing options...
trinklins Posted April 2, 2004 Author Report Share Posted April 2, 2004 re kā viss notiek tipa this tas ir atslēgvārds kas norāda uz doto objektu. Link to comment Share on other sites More sharing options...
Recommended Posts