
02.03.2008, 12:58
|
|
Познавший АНТИЧАТ
Регистрация: 16.04.2006
Сообщений: 1,488
Провел на форуме: 2209675
Репутация:
537
|
|
вот, уменьшенный код - тут остаётся тока вставить его в php-файл и нажать сабмит.
тогда выведется всё содержимое массива POST и будет видно что дата отсутствует. Помогите с этим разобраться, пожалуйста!
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">
</head>
<body>
<script type='text/javascript'>
// highlight active input field
function highlight(element, mode){
if(mode == 'enable')
document.getElementById(element).style.backgroundColor = '#FFFFCC';
else
document.getElementById(element).style.backgroundColor = '#FFF';
}
// 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.createElement('select'), i
for (i = 1; i <= days; i++){
toption = document.createElement('option');
toption.value = i;
toption.text = i;
list.appendChild(toption);
}
day_slot.parentNode.replaceChild(list, day_slot);
list.id = 'date_day';
}
function getValue(id){
var node = document.getElementById(id);
return node.options[node.selectedIndex].value
}
window.onload = function(){
createDate(getValue('date_month'));
}
</script>
<h3>Add user</h3>
<form name="newuser" method="POST" onSubmit="return validate()">
<table border="0" >
<tr>
<td>birthday:</td>
<td>
<select id="date_month" name="date_month" onchange="createDate(this.options[this.selectedIndex].value)" >
<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(document.getElementById('date_month').options[document.getElementById('date_month').selectedIndex].value)" />
</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>
|
|
|