Jump to content

Submit to Hidden UL


Xtremer360

Recommended Posts

What I want to do is when Add is clicked after choosing a charactername then it drops down into a ul where each charactername would be put into a li and obviously more than one can be chosen. And until one is added then it says "This handler does not have any characters assigned."

 

print'<h2 class="backstage">Characters<br /><br /><input type="hidden" name="action" value="handler"><input type="hidden" name="routine" value="addcharacter"><input type="hidden" name="option" value="0"><input type="hidden" name="id" value="0"><select name="characterid" class="dropdown">';
print'<option value="0">- Select -</option>';
$query = 'SELECT charactername FROM characters';
            $result = mysql_query($query);
            while ($row = mysql_fetch_assoc($result))
            {
            print "<option value=\"{$row['charactername']}\">{$row['charactername']}</option>\r";
            }            
print'</select>  <input type="submit" value="Add" class="button" ></form></h2><br />';
print'This handler does not have any characters assigned.<br /><br />';

Link to comment
Share on other sites

Something like this:

 

print'<form method=POST name=handlermodule>';
print'<input type=hidden name=action value=handler>';
print'<input type=hidden name=routine value=0>';
print'<input type=hidden name=id value=0>';
print'<input type=hidden name=characterid value=0>';
print'<input type=hidden name=option value=0>';
print'</form>';
print'<script type="text/javascript" language="javascript">
function executeformhandler(routine,id,characterid,option) {
document.handlermodule.routine.value = routine;
document.handlermodule.id.value = id;
document.handlermodule.characterid.value = characterid;
document.handlermodule.option.value = option;
document.handlermodule.submit();
}
</script>';

Link to comment
Share on other sites

New Code I have some JS and a executeform function check it out. But I want it to play the selected value in a new li below.

 

function newhandler() {
if (isset ($_POST['submit'])) { // Handle the form.

// Define the query.
$salt = "rweweroiu23i4u89wu89fu9sadhfiuhaw89eriuahdfuiwher";
$password = md5(md5(md5(encrypt(md5(md5($password.$salt))))));
$login = $_POST['login'];
$p = $_POST['password'];
$surname = $_POST['surname'];
$firstname = $_POST['firstname'];
$email = $_POST['email'];
$aim = $_POST['aim'];
$msn = $_POST['msn'];
$forumid = $_POST['forumid'];
$account = $_POST['account'];
$admin = $_POST['admin'];
$query = "INSERT INTO users (username, password, surname, firstname, email, aim, msn, forumid, status, admin) VALUES ('$login', '$p','$surname','$firstname', '$email', '$aim', '$msn', '$forumid', '$account', '$admin')";

// Execute the query.
    if (@mysql_query ($query)) {
        print '<p>The handler has been added.</p>';
    } else {
        print '<p>Could not add the entry because: <b>" . mysql_error() . "</b>. The query was $query.</p>';
    }
    
    mysql_close(); 

} 
print'<h1 class="backstage">Handler Management</h1><br />';
print'<h2 class="backstage">Add New Handler Account</h2><br />';
print'<form name="newhandler" action="backstage.php" method="post" >';
print'<table width="100%" class="table2">';
print'<tr>';
print'<td width="120" class="rowheading">Username:</td><td class="row3"><input type="text" name="login" class="fieldtext490"></td>';
print'</tr>';
print'<tr>';
print'<td class="rowheading">Password:</td><td class="row3"><input type="password" name="password" class="fieldtext490"></td>';
print'</tr>';
print'<tr>';
print'<td class="rowheading">Surname:</td><td class="row3">';
print'<input type="text" name="surname" class="fieldtext490"></td>';
print'</tr>';
print'<tr>';
print'<td class="rowheading">Firstname:</td>';
print'<td class="row3"><input type="text" name="firstname" class="fieldtext490"></td>';
print'</tr>';
print'<tr>';
print'<td class="rowheading">Email:</td>';
print'<td class="row3"><input type="text" name="email" class="fieldtext490"></td>';
print'</tr>';
print'<tr>';
print'<td class="rowheading">AIM:</td>';
print'<td class="row3"><input type="text" name="aim" class="fieldtext490"></td>';
print'</tr>';
print'<tr>';
print'<td class="rowheading">MSN:</td>';
print'<td class="row3"><input type="text" name="msn" class="fieldtext490"></td>';
print'</tr>';
print'<tr>';
print'<td class="rowheading">Forum ID:</td>';
print'<td class="row3"><input type="text" name="forumid" class="fieldtext490"></td>';
print'</tr>';
print'<tr>';
print'<td class="rowheading">Account:</td>';
print'<td class="row3"><select name="account" class="selection">';
print'<option value="1">Enabled</option><option value="2">Disabled</option>';
print'</select></td>';
print'</tr>';
print'<tr>';
print'<td class="rowheading">Administrator:</td>';
print'<td class="row3"><select name="admin" class="selection">';
print'<option value="2">No</option><option value="1">Yes</option>';
print'</select></td>';
print'</tr>';
print'</table><br />';
print'<input type="submit" value="Save Handler" class="button" name="submit"></form><br />';
print'<input type="hidden" name="action" value="handlers"><input type="submit" value="Return to Handler List" class="button200"><br />';
print'<form method="POST" name="handlermodule">';
print'<input type="hidden" name="action" value="handler">';
print'<input type="hidden" name="routine" value="0">';
print'<input type="hidden" name="id" value="0">';
print'<input type="hidden" name="characterid" value="0">';
print'<input type="hidden" name="option" value="0">';
print'</form>';
print'<script type="text/javascript" language="javascript">
function executeformhandler(routine,id,characterid,option) {
document.handlermodule.routine.value = routine;
document.handlermodule.id.value = id;
document.handlermodule.characterid.value = characterid;
document.handlermodule.option.value = option;
document.handlermodule.submit();
}
</script>';
print'<h2 class="backstage">Characters<br /><br /><form method=post><input type=hidden name=action value=handler><input type=hidden name=routine value=addcharacter><input type=hidden name=option value=0><input type=hidden name=id value="0"><select name="characterid" class="dropdown">';
print'<option value="0">- Select -</option>';
$query = 'SELECT charactername FROM characters';
            $result = mysql_query($query);
            while ($row = mysql_fetch_assoc($result))
		{
            print "<option value=\"{$row['charactername']}\">{$row['charactername']}</option>\r";
            }             
print'</select>  <input type="submit" value="Add" class="button" ></form></h2><br />';
print'<ul></ul>';
print'This handler does not have any characters assigned.<br /><br />';
print'<h2 class="backstage"><form method="POST"><input type="hidden" name="action" value="mainmenu"><input type="submit" value="Return to Main Menu" class="button200"></form></h2>';
}

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.