Jump to content

Smart Drop Down Menu


Recommended Posts

I know this should be made with ajax, but i have no idea from where start.

 

I'd like to show the option "Escola" only if the option "Administrador" or "Moderador" be selected in the option "Status". How can i do that?

 

<?php
session_start();
require_once('includes/auth.php');
?>

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Registrar Usuario</title>
<link rel="stylesheet" href="../../css/styles.css" type="text/css">
</head>
<body>
<h1>Registrar Usuario</h1>

<?php
	include("includes/header.php");
?>

<p>Uma senha sera gerada e enviada para o email do usuario.</p>
<form id="loginForm" name="loginForm" method="post" action="../../actions/sadmin_register_user.php">
	<table width="300" border="0" align="left" cellpadding="2" cellspacing="0">
		<tr>
			<th>Status</th>
			<td>
				<select name="school" id="school" > ";
					<option value="1">Super Administrador</option>
					<option value="2">Super Moderador</option>
					<option value="3">Administrador</option>
					<option value="4">Moderador</option>
				</select>
			</td>
		</tr>
		<tr>
			<th>Escola</th>
			<td>

				<?php

				require_once('../../includes/link.php');

				$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);

				$query = "SELECT * FROM schools";
				$result = mysql_query($query);

				echo "<select name=\"school\" id=\"school\" > ";

				while($row = mysql_fetch_array($result)) {

				echo "<option value=\"" . $row['id'] . "\">" . $row['name'] . "</option>";

				}

				echo "</select>";

				?>
			</td>
		</tr>
		<tr>
			<th>Nome Completo</th>
			<td><input name="name" type="text" class="textfield" id="name" /></td>
		</tr>
		<tr>
			<th>Email</th>
			<td width="168"><input name="email" type="text" class="textfield" id="email" /></td>
		</tr>
		<tr>
			<th>Confirmar Email</th>
			<td><input name="cemail" type="text" class="textfield" id="cemail" /></td>
		</tr>
		<tr>
			<td> </td>
			<td><input type="submit" name="Submit" value="Registrar" /></td>
		</tr>
	</table>
</form>
</body>
</html>

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.