Jump to content
php.lv forumi

kautkas nefuračī


trinklins

Recommended Posts

<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

<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

  • 2 weeks later...

<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 by trinklins
Link to comment
Share on other sites

Š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

×
×
  • Create New...