0

Does anyone know if it's possible to have several text fields that place the data into different spots in the same web page. If needed I could just use two pages, it doesn't really matter. I've heard this requires a PHP script, but I'm not sure how to set this up.

any help is appreciated! Thanks

3
Contributors
11
Replies
13
Views
7 Years
Discussion Span
Last Post by diafol
Featured Replies
  • 1
    diafol 3,720   7 Years Ago

    Yes it's possible. Your data is passed from the form to the next page (or the same page) where it is processed via the $_POST variable. You then PARSE the data - searching for return characters - and turn that data into an ARRAY. You then have a a php … Read More

0

Hey there,

I think the reason you haven't seen activity here lately may be because what I am also feeling a bit: confusion. I'm not entirely clear on what you mean with your request. What, specifically, are you trying to accomplish? Are you referring to text fields with the same names/ids? What do you mean when you say "place data into different spots"..? I'm a bit unclear on what you're talking about here, but am willing to try and help if you can clear it up a little.

0

Hey there,

I think the reason you haven't seen activity here lately may be because what I am also feeling a bit: confusion. I'm not entirely clear on what you mean with your request. What, specifically, are you trying to accomplish? Are you referring to text fields with the same names/ids? What do you mean when you say "place data into different spots"..? I'm a bit unclear on what you're talking about here, but am willing to try and help if you can clear it up a little.

Let me rephrase my question. I am trying to take data put into a textarea or field and have it show up in different parts of the webpage.

I am doing this for a question and answer document. Basically a user (ie teacher) would type several question and their answers into a text field, and they would appear in other parts of the document in a certain order. This allows them to scroll through the document or use a hyperlink and see the question, and then scroll/hyperlink to the answer.

My problem is that I don't know how to take the questions/answers typed into the text fields and place them into the desired location in the webpage without the user knowing html coding.

Does this clear up the question??

P.S. Not to push it further, but it would be nice to also have a single textarea that interprets each line as a new field. This would then allow the user to copy his or her questions into a text document to be saved for later. Like the box used in part 1 of this site: http://www.random.org/lists/

If this isn't possible, however, don't bother. I would be fine with single textfields.


THANKS!!

Edited by commandgeek: n/a

1

Yes it's possible.
Your data is passed from the form to the next page (or the same page) where it is processed via the $_POST variable. You then PARSE the data - searching for return characters - and turn that data into an ARRAY.

You then have a a php array variable and can echo (display) any of individual items wherever you want. For example.

$my_questions_form = trim($_POST['questions']);
$array_questions = explode(Chr(13),$my_questions_form);

Show us what you have so far.

0

Thanks, I try this soon.


P.S. What I have so far is actually pretty neat. It's basically done save this issue. See the attatched for the current version. Soon I'll post the finished version here as well.

I views best in internet explorer because that's the browser I expect most of the users will be using, but it works fine in other browsers like firefox or google chrome--it just looks a little funky, especially with check boxes. Also you can't save it yet, and the music is saved on my computer, so that won't work either.

Other than that it works fine! Just save the txt as an htm to view the file(won't upload as an html)

Attachments
<html lang="en"><head><title>JEOPARDY TEMPLATE</title>

<!--- for setup/options fade--->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>

<STYLE>
body, input{
	font-family: Calibri, Arial;
}

#sometext {
	width: 1200px;
	height: 600px;
	padding: 0px;
	border:1px solid black;
	background-color: #3300cc;
}
</STYLE>

<!--- for updating answers and q --->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript">
window.onload=function(){
var aInput=document.getElementsByTagName('input');
for(var i=0; i<aInput.length; i++) {
    aInput[i].onblur=update;
    }
};

function update() {
var f=document.form1;
f.textarea1.value='file.swf?bgcolor='+f.bgcolor.value+'&amp;color2='+f.color2.value+'&amp;color3='+f.color3.value+'&amp;color4='+f.color4.value;
}
</script>

<style type="text/css">
label {display:block;} 
</style>







</head><body bgcolor="#3300cc" link="#ffffff" alink="#ffffff" vlink="#ffffff"><a name="top"><font face="times new roman"><font font size="5" color="#ffffff">Jeopardy! <i>Round 1</i><form><table width="100%" border="#ffffff">
<tr>
<td><font size="7" color="#ffffff">1</td>
<td><font size="7" color="#ffffff">2</td>
<td><font size="7" color="#ffffff">3</td>
<td><font size="7" color="#ffffff">4</td>
<td><font size="7" color="#ffffff">5</td>
</tr>

<tr>
<td><a href="#1-100"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">100</a></td>
<td><a href="#2-100"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">100</a></td>
<td><a href="#3-100"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">100</a></td>
<td><a href="#4-100"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">100</a></td>
<td><a href="#5-100"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">100</a></td>
</tr>

<tr>
<td><a href="#1-200"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">200</a></td>
<td><a href="#2-200"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">200</a></td>
<td><a href="#3-200"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">200</a></td>
<td><a href="#4-200"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">200</a></td>
<td><a href="#5-200"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">200</a></td>
</tr>

<tr>
<td><a href="#1-300"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">300</a></td>
<td><a href="#2-300"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">300</a></td>
<td><a href="#3-300"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">300</a></td>
<td><a href="#4-300"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">300</a></td>
<td><a href="#5-300"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">300</a></td>
</tr>

<tr>
<td><a href="#1-400"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">400</a></td>
<td><a href="#2-400"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">400</a></td>
<td><a href="#3-400"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">400</a></td>
<td><a href="#4-400"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">400</a></td>
<td><a href="#5-400"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">400</a></td>
</tr>

<tr>
<td><a href="#1-500"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">500</a></td>
<td><a href="#2-500"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">500</a></td>
<td><a href="#3-500"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">500</a></td>
<td><a href="#4-500"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">500</a></td>
<td><a href="#5-500"><font size="7" color="#ffffff"><input name="checkbox2" type="checkbox" style="height: 50px; width: 50px;">500</a></td>
</tr></table>
<input type="reset" value="Clear Board"/></form>

<input type="button" value="Hide Instructions" onclick="fade('sometext', this)"/>

<br/><br/>
<div id="sometext">
<font size="5">Rest the mouse on the image of the archer to see the answer to each question.  <br>Push F11 to view in full screen mode.  Push it again to exit full screen mode.  <br>Push Ctrl+S to save your game.  It takes several seconds for the browser window to open.  <br> To operate the board, first click the checkbox next to the value, and then select the value.  This will redirect you to the question.  </font><br>
</p><font size="5"><a href="#setup">Setup/Change Game</a><br><a href="#theme">Adjust Jeopardy Theme</a></font>
</div>





<table width="100%"><form>
<tr><td><font color="#ffffff">Team 1:<select><option>+</option><option>-</option></select>
<select>
  <option></option>
  <option>100</option>
  <option>200</option>
  <option>300</option>
  <option>400</option>
  <option>500</option>
  <option>600</option>
  <option>700</option>
  <option>800</option>
  <option>900</option>
  <option>1000</option>
  <option>1100</option>
  <option>1200</option>
  <option>1300</option>
  <option>1400</option>
  <option>1500</option>
  <option>1600</option>
  <option>1700</option>
  <option>1800</option>
  <option>1900</option>
  <option>2000</option>
  <option>2100</option>
  <option>2200</option>
  <option>2300</option>
  <option>2400</option>
  <option>2500</option>
  <option>2600</option>
  <option>2700</option>
  <option>2800</option>
  <option>2900</option>
  <option>3000</option>
  <option>3100</option>
  <option>3200</option>
  <option>3300</option>
  <option>3400</option>
  <option>3500</option>
  <option>3600</option>
  <option>3700</option>
  <option>3800</option>
  <option>3900</option>
  <option>4000</option>
  <option>4100</option>
  <option>4200</option>
  <option>4300</option>
  <option>4400</option>
  <option>4500</option>
  <option>4600</option>
  <option>4700</option>
  <option>4800</option>
  <option>4900</option>
  <option>5000</option>
  <option>5100</option>
  <option>5200</option>
  <option>5300</option>
  <option>5400</option>
  <option>5500</option>
  <option>5600</option>
  <option>5700</option>
  <option>5800</option>
  <option>5900</option>
  <option>6000</option>
  <option>6100</option>
  <option>6200</option>
  <option>6300</option>
  <option>6400</option>
  <option>6500</option>
  <option>6600</option>
  <option>6700</option>
  <option>6800</option>
  <option>6900</option>
  <option>7000</option>
  <option>7100</option>
  <option>7200</option>
  <option>7300</option>
  <option>7400</option>
  <option>7500</option>
  </select></td>

<td><font color="#ffffff">Team 2:<select><option>+</option><option>-</option></select>
<select>
  <option></option>
  <option>100</option>
  <option>200</option>
  <option>300</option>
  <option>400</option>
  <option>500</option>
  <option>600</option>
  <option>700</option>
  <option>800</option>
  <option>900</option>
  <option>1000</option>
  <option>1100</option>
  <option>1200</option>
  <option>1300</option>
  <option>1400</option>
  <option>1500</option>
  <option>1600</option>
  <option>1700</option>
  <option>1800</option>
  <option>1900</option>
  <option>2000</option>
  <option>2100</option>
  <option>2200</option>
  <option>2300</option>
  <option>2400</option>
  <option>2500</option>
  <option>2600</option>
  <option>2700</option>
  <option>2800</option>
  <option>2900</option>
  <option>3000</option>
  <option>3100</option>
  <option>3200</option>
  <option>3300</option>
  <option>3400</option>
  <option>3500</option>
  <option>3600</option>
  <option>3700</option>
  <option>3800</option>
  <option>3900</option>
  <option>4000</option>
  <option>4100</option>
  <option>4200</option>
  <option>4300</option>
  <option>4400</option>
  <option>4500</option>
  <option>4600</option>
  <option>4700</option>
  <option>4800</option>
  <option>4900</option>
  <option>5000</option>
  <option>5100</option>
  <option>5200</option>
  <option>5300</option>
  <option>5400</option>
  <option>5500</option>
  <option>5600</option>
  <option>5700</option>
  <option>5800</option>
  <option>5900</option>
  <option>6000</option>
  <option>6100</option>
  <option>6200</option>
  <option>6300</option>
  <option>6400</option>
  <option>6500</option>
  <option>6600</option>
  <option>6700</option>
  <option>6800</option>
  <option>6900</option>
  <option>7000</option>
  <option>7100</option>
  <option>7200</option>
  <option>7300</option>
  <option>7400</option>
  <option>7500</option>
  </select></td>
<td><font color="#ffffff">Team 3:<select><option>+</option><option>-</option></select>
<select>
  <option></option>
  <option>100</option>
  <option>200</option>
  <option>300</option>
  <option>400</option>
  <option>500</option>
  <option>600</option>
  <option>700</option>
  <option>800</option>
  <option>900</option>
  <option>1000</option>
  <option>1100</option>
  <option>1200</option>
  <option>1300</option>
  <option>1400</optio
0

Yes it's possible.
Your data is passed from the form to the next page (or the same page) where it is processed via the $_POST variable. You then PARSE the data - searching for return characters - and turn that data into an ARRAY.

You then have a a php array variable and can echo (display) any of individual items wherever you want. For example.

$my_questions_form = trim($_POST['questions']);
$array_questions = explode(Chr(13),$my_questions_form);

Show us what you have so far.

OK, I thought I had it, then I lost it. How many php pages and html pages am I supposed to have, and what goes on each of them? In other words, where the heck does all this stuff go?

Thanks! I appreciate any help you could give me!

0

I'll see what I can do about the screen shot. It won't let me add the html form of the doc. The easiest thing to do is just open the document, save it as an .htm and open the html.

0

So you want me to do that? You could post the code inside code tags. Don't see why I should have to download, rename, browse.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.