943,935 Members | Top Members by Rank

Ad:
Jun 15th, 2006
0

Help with making a survey form

Expand Post »
Hey guys, I was curious if someone would be able to provide advice on how to do this... Basically I want to create a simple web-form that has a bunch of questions and allows the user to answer them. Then it has to pass the list of questions under one "name" element. Here is what I have so far:

HTML and CSS Syntax (Toggle Plain Text)
  1. <form name="bulletinForm" method="post" target="_self" action="http://bulletin.myspace.com/index.cfm?fuseaction=bulletin.edit">
  2. <input type="hidden" value="0" name="groupID">
  3. <input class="htmlgenscom" type="hidden" maxLength="50" size="1" value="The Greatest Survey Ever!" name="subject">
  4.  
  5. <p>Question 1?</p>
  6. <textarea class="htmlgenscom" name="body" type="hidden" style="width: 0px; height: 0px;" rows="1" cols="20"><ul><li><b>Question 1?</b><br></textarea>
  7. <input type="text" name="body" size="30" maxlength="100" rows="1" cols="20">
  8. <p>Question 2</p>
  9. <textarea class="htmlgenscom" name="body" type="hidden" style="width: 0px; height: 0px;" rows="1" cols="20"></li><li><b>Question 2?</b><br></textarea>
  10. <input type="text" name="body" size="30" maxlength="100" rows="1" cols="20">
  11.  
  12. <textarea class="htmlgenscom" name="body" type="hidden" style="width: 0px; height: 0px;" rows="1" cols="20"></li></ul></textarea><br><br>
  13. <input type=submit class=submit value="Post the Survey on Myspace!" name="submit0" target="_blank">
  14. </form>
Basically it passes these elements to the Myspace bulletin form to automatically post the questions and answers in the users bulletin. It works pretty well how I set it up, except around each answer (the "input type="text"" boxes) there is a comma when you see the output. Alittle confusing I know. You can see a example here: http://www.bloonlabs.com/myspacequiz.htm

Hope someone can help!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
qbit is offline Offline
7 posts
since May 2006
Jun 15th, 2006
0

Re: Help with making a survey form

I am trying to make it in php so I can "build the textbox" in a php file then have the user submit it. I have two questions however:

1. I am getting lots of random php errors like "unexpected T-string" of which I can see no error...

2. Could I make the php file automatically submit the "textbox" or information to the myspace post bulliton form? Rather than making the user press a second button?

Here is my code (this is only the code within the body tags...):

First page:

HTML and CSS Syntax (Toggle Plain Text)
  1. <div align="center"><form name="bulletinForm" method="post" target="_self" action="submit.php">
  2.  
  3. <p>Who is the last person you high-fived?:
  4. <textarea class="htmlgenscom" name="question1" type="hidden" style="width: 0px; height: 0px;" rows="1" cols="20">Who is the last person you high-fived?</textarea>
  5. <input type="text" name="answer1" size="30" maxlength="100" rows="1" cols="20"></p>
  6.  
  7. <p>If you were drafted into a war, would you survive?:
  8. <textarea class="htmlgenscom" name="question2" type="hidden" style="width: 0px; height: 0px;" rows="1" cols="20">If you were drafted into a war, would you survive?</textarea>
  9. <input type="text" name="answer2" size="30" maxlength="100" rows="1" cols="20"></p>
  10.  
  11. <input type="submit" value="Post this survey on your Myspace!" name="submit">
  12. </form><div align="center">
Here is the php "submit" page:
HTML and CSS Syntax (Toggle Plain Text)
  1. <?php
  2. $question1 = $_POST['question1'];
  3. $question2 = $_POST['question2'];
  4. $answer1 = $_POST['answer1'];
  5. $answer2 = $_POST['answer2'];
  6. echo ("<div align="center"> <form name="bulletinForm" method="post" target="_self" action="bulletin.myspace.com\index.cfm?fuseaction=bulletin.edit"> <input type="hidden" value="0" name="groupID"> <input class="htmlgenscom" type="hidden" maxLength="50" size="1" value="The Greatest Survey Ever" name="subject"> <br> <textarea class="htmlgenscom" name="body" type="hidden" rows="1" cols="20"> ");
  7. echo ($question1 . ": " . $answer1 . "<br> " . $question2 . ": " . $answer2);
  8. echo ("</textarea> <br> <br> <input type="submit" class="submit" value="Press here to Submit!" name="submit" target="_blank"> </form> </div> ");
  9. ?>

A live example can be found here: http://www.bloonlabs.com/myspacequiz/test.htm
Last edited by qbit; Jun 15th, 2006 at 4:54 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
qbit is offline Offline
7 posts
since May 2006
Jun 15th, 2006
0

Re: Help with making a survey form

Ok, I fixed my unexpected T_string error, but how would I go about making the "submit.php" file automatically submit the text box to the myspace post bulleton?

And another question, how can I make my php-submit form automatically count how many questions and answers are passed onto it?
Last edited by qbit; Jun 15th, 2006 at 5:07 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
qbit is offline Offline
7 posts
since May 2006
Jun 15th, 2006
0

Re: Help with making a survey form

This isn't the PHP forum, and your project is a bit too involved for the casual volunteer to help out. Forums such as this are best used for very specific questions about a particular aspect of HTML/CSS/JavaScript.
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004
Jun 15th, 2006
0

Re: Help with making a survey form

Wow... I am so sorry. I seriously thought that I had clicked the php forum. Crap. Ok, well, I have fixed most of this. Thanks for the reminder. ^_^
Reputation Points: 10
Solved Threads: 0
Newbie Poster
qbit is offline Offline
7 posts
since May 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: RollOver
Next Thread in HTML and CSS Forum Timeline: CSS hover on individual link (li) ???





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC