|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
a TEASER 4 U ALL
hi friends, gud morning, well i have a simple query 2 ask u.
look i have a script that displays a question to a user along with 3 answers from which he has to choose one. once he chooses an answer and clicks on submit button, he gets a message whether it is correct or not. also the next question appears.all this works fine. but incase the user doesnt choose any answer and clicks the submit button, i awnt that he should get an javascript alert box to popup saying he should choose one answer . And only on choosing an answer should the next question appear. kindly tell me how this can b done. i am sending the extract of my script.waiting for a solution very badly.plz help php Code:
|
|
#2
|
|||
|
|||
|
RE: a TEASER 4 U ALL
<form action="result.php" method="post" onsubmit="cheka()" name="form1">
<script language="JavaScript"> function cheka(){ if(!form1.corr.checked){alert('Answer plz');return false;} } </script> try it! |
|
#3
|
|||||
|
|||||
|
RE: a TEASER 4 U ALL
well it works but not the way i want...i changed onsubmit to onmouseover..
php Code:
now the problem is that even when i select one of the answers and move the mose over the button i get the alert which shouldnt happen the alert shld pop only when i dont select any answer |
|
#4
|
|||
|
|||
|
RE: a TEASER 4 U ALL
<input type='submit' name='submit' value='OK' onmouseover="cheka1()">
<script language="JavaScript"> function cheka1(){ if(!form1.corr.checked){alert('Answer plz');return false;} } </script> i think in that way u can do it. |
|
#5
|
|||
|
|||
|
RE: a TEASER 4 U ALL
ooopsss!! that does not work....soorrry.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > a TEASER 4 U ALL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|