
02.03.2008, 14:38
|
|
Постоянный
Регистрация: 30.08.2007
Сообщений: 773
Провел на форуме: 3069349
Репутация:
808
|
|
PHP код:
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST'){
echo "<pre>";
print_r($_POST);
echo "</pre>";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>admin utility</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<script type='text/javascript'>
// birthday functions -----------------
// update days list
function createDate(month)
{
var day_slot = document.getElementById('date_day');
var date = new Date();
date.setMonth(month);
var year = parseInt( document.getElementById('date_year').value );
if((year < 1920) || (year > date.getFullYear())) year = date.getFullYear();
date.setFullYear(year);
date.setDate(32);
var days = 32 - date.getDate(),
list = document.createDocumentFragment(), o, t, i;
while (day_slot.hasChildNodes())
{
day_slot.removeChild(day_slot.firstChild);
}
for (i = 1; i <= days; i++)
{
o = document.createElement('option');
t = document.createTextNode(i);
o.value = i;
list.appendChild(o);
o.appendChild(t);
}
day_slot.appendChild(list);
}
function getValue()
{
var a = arguments;
if(!a[0]) return;
if(typeof a[0] == 'string')
{
var node = document.getElementById(a[0]);
return node.options[node.selectedIndex].value;
}
else if(a[0].nodeName)
{
return a[0].options[a[0].selectedIndex].value;
}
}
window.onload = function()
{
createDate(getValue('date_month'));
}
</script>
</head>
<body>
<h3>Add user</h3>
<form name="newuser" method="POST">
<table border="0">
<tr>
<td>Birthday:</td>
<td>
<select id="date_month" name="date_month" onchange="createDate(getValue(this))">
<option value='0'>January</option>
<option value='1'>February</option>
<option value='2'>March</option>
<option value='3'>April</option>
<option value='4'>May</option>
<option value='5'>Juny</option>
<option value='6'>July</option>
<option value='7'>August</option>
<option value='8'>September</option>
<option value='9'>October</option>
<option value='10'>November</option>
<option value='11'>December</option>
</select>
<select id="date_day" name="date_day"></select>
<input type="text" maxlength="4" value="19" id="date_year" name="date_year" size="4" onblur="createDate(getValue('date_month'))" />
</td>
</tr>
<tr style="height: 50px">
<td> </td><td style="vertical-align: bottom"><input type="submit" value="submit" /> <input type="reset" value="reset" /></td>
</tr>
</table>
</form>
</body>
</html>
|
|
|