View Full Version : Help.Set table raw based on dropbox value

08-02-2011, 10:50 PM
Hello, i got a problem. I have a form with a drop box which take values from db table, now i want when the submit button pressed a raw of characters table based on box value copied to another table. here is the code.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="js/fns.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/form/view.css" media="all">
<script type="text/javascript" src="css/form/view.js"></script>
<script src="includes/jquery-1.2.6.min.js" type="text/javascript" charset="utf-8"></script>
<script src="includes/jquery.form.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">

$(document).ready(function() {
target: '#error',
success: function() {

label.error { width: 250px; display: inline; color: red;}
<body id="main_body" >

<div id="form_container">

<form id="form_222202" class="appnitro" method="post" action="getuser.php">

<ul >

<li id="li_1" >
<label class="description" for="element_1">Choose your
victims </label>
$sql = "SELECT charactername FROM characters";
$result = mysql_query($sql);
<select class="element select medium" id="element_1" name="element_1" onchange="submit()">
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
<option value="<?php echo $line['charactername'];?>"> <?php echo $line['charactername'];?> </option>



<li class="buttons">
<input type="hidden" name="form_id" value="222202" />

<input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />



and her is getuser.php :


$value = $_POST["element_1"];

$sql="INSERT INTO playnow SELECT image FROM characters WHERE charactername="$value" ";

$result = mysql_query($sql);
echo '.$value.';


can anyone help me?:confused: