Jump to content
php.lv forumi

Recommended Posts

Posted

Sveiki!

Taisīju formu aptaujai, taču pēkšņi sanāk tā, ka tiek ļauts čekot visus parādītos radio input, nevis vienu, kā tam vajadzētu būt.

Kur varētu būt kļūdiņa?

    echo "<p>$pollquestion<p>";
   echo "<form action=\"\">";
   if($pollanswer5 != ""){
   echo "<p><input type=\"radio\" value=\"answer1\" />$pollanswer1</p>";
   echo "<p><input type=\"radio\" value=\"answer2\" />$pollanswer2</p>";
   echo "<p><input type=\"radio\" value=\"answer3\" />$pollanswer3</p>";
   echo "<p><input type=\"radio\" value=\"answer4\" />$pollanswer4</p>";
   echo "<p><input type=\"radio\" value=\"answer5\" />$pollanswer5</p>";
   }elseif($pollanswer3 == ""){
   echo "<p><input type=\"radio\" value=\"answer1\" />$pollanswer1</p>";
   echo "<p><input type=\"radio\" value=\"answer2\" />$pollanswer2</p>";    
   }elseif($pollanswer4 == ""){
   echo "<p><input type=\"radio\" value=\"answer1\" />$pollanswer1</p>";
   echo "<p><input type=\"radio\" value=\"answer2\" />$pollanswer2</p>";
   echo "<p><input type=\"radio\" value=\"answer3\" />$pollanswer3</p>";
   }elseif($pollanswer5 == ""){
   echo "<p><input type=\"radio\" value=\"answer1\" />$pollanswer1</p>";
   echo "<p><input type=\"radio\" value=\"answer2\" />$pollanswer2</p>";
   echo "<p><input type=\"radio\" value=\"answer3\" />$pollanswer3</p>";
   echo "<p><input type=\"radio\" value=\"answer4\" />$pollanswer4</p>";
   } 
   echo "<input type=\"submit\" value=\"Vote\" />";
   echo "</form>";

Posted

Ieteikums, ko visi iesaka visiem, un arī man tas ir ieteikts šajā forumā sendienas - "Kodu pārlasi 100 reizes pirms, meklē palīdzību - problēma ir tev acu galā, tik salīdzini ar kautko".

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...