juniorek9 Posted December 10, 2010 Share Posted December 10, 2010 Hi all. i have problems with making a questionnaire. i have done a single questions but i have no idea how to add them al ltogether so they work as switch function. i`ve attached one of the questions. could anyone suggest how i make answers into a list rather than just a line of options? [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/221244-extension/ Share on other sites More sharing options...
OOP Posted December 10, 2010 Share Posted December 10, 2010 Do you mean that you need to print each answer in a line by itself? If yes, then you can do as shown below <h1>Would You rather?</h1> <?php $transport = array('r' => 'Cruise the street in your hot ride', 'a' => 'Join the army', 'p' => 'go to a science convention', 'h' => 'stay home and work on the computer'); foreach ($transport as $key => $transport) { echo "<input type='radio' name='transport' value='$key'/> $transport <br/>" ; } ?> <input type="submit" value="go"> </html> just changed the \n to <br/> in this line echo "<input type='radio' name='transport' value='$key'/> $transport Quote Link to comment https://forums.phpfreaks.com/topic/221244-extension/#findComment-1145493 Share on other sites More sharing options...
juniorek9 Posted December 10, 2010 Author Share Posted December 10, 2010 yes. i would like them to be as a list. i know there is the <li> function but im not sure how to use it and where exactly i shoul put it in Quote Link to comment https://forums.phpfreaks.com/topic/221244-extension/#findComment-1145498 Share on other sites More sharing options...
OOP Posted December 11, 2010 Share Posted December 11, 2010 You can achieve this as I showed you in my last reply. Give it a try Quote Link to comment https://forums.phpfreaks.com/topic/221244-extension/#findComment-1145685 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.