Jump to content

[SOLVED] Form with while loop


thefollower

Recommended Posts

Is it possible to add a while loop inside a html box to print out the options for the user.. this is what i got and ill explain what i mean below:

 

<?php
$Check = mysql_query("SELECT * FROM countryusercoords WHERE CountryID='$CountryID'")
or die(mysql_error());
$CheckRow = mysql_fetch_assoc($Check);
If(mysql_num_rows($CheckRow) > 0){


?>
<form name="" method="POST" action="uktravelattack.php" id="Form1" onsubmit="return ValidateForm1(this)">
<textarea name="TextArea1" id="TextArea1" style="position:absolute;left:49px;top:53px;width:440px;height:250px;z-index:0" rows="14" cols="46">
</textarea>
<input type="submit" id="Button1" name="Button1" value="Attack" style="position:absolute;left:217px;top:347px;width:75px;height:24px;z-index:1">
<input type="checkbox" id="Checkbox1" name="Checkbox1" value="" style="position:absolute;left:319px;top:348px;z-index:2">
<div id="bv_Text9" style="position:absolute;left:56px;top:352px;width:150px;height:16px;z-index:3" align="center">
<font style="font-size:13px" color="#FFFFFF" face="Arial"><i>Costs 50 Energy!</i></font></div>
</form>

 

Regarding:

<textarea name="TextArea1" id="TextArea1" style="position:absolute;left:49px;top:53px;width:440px;height:250px;z-index:0" rows="14" cols="46">
</textarea>

 

Is there a way to add a while loop for that query so that it will print the rows... and then that allows the user to select which row they want and then when they press submit it will carry that row to the process page?

Link to comment
Share on other sites

The short answer is, of course, yes...

 

The longer answer is, if we populate a text area with all of the data, they won't be able to select one piece of that data. Instead, they would have to delete all of the data they don't want, leaving the one thing they do want. A better idea here, if you want them to be able to select one thing, is to either provide the data in a drop-down, or as separate radio button items.

 

PhREEEk

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.