Lord Posted March 1, 2011 Report Share Posted March 1, 2011 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>"; Quote Link to comment Share on other sites More sharing options...
m8t Posted March 1, 2011 Report Share Posted March 1, 2011 Neesi definējis name="". Saliec pilnīgi visiem saviem radio button'iem name="blalabla" un viss tev strādās. Quote Link to comment Share on other sites More sharing options...
Lord Posted March 1, 2011 Author Report Share Posted March 1, 2011 m8t taisnība, paldies. Quote Link to comment Share on other sites More sharing options...
Kemito Posted March 1, 2011 Report Share Posted March 1, 2011 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". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.