Page 1 of 1
form for reservation
Posted: Tue Mar 06, 2007 2:13 pm
by hrubos
Actually I need a suggestion. I have to do a page about reservation, which is written by PHP.
And I have a form :
+ output all of room, in which is nobody from database in to a table
+ the last collumn of table is date, when traveller come to --> I want display a calendar and I can chose day on this calendar.
Ah, I have tried popup calendar but I have had error.
Anyway, who have a good link for this, so please send me!!!
Posted: Tue Mar 06, 2007 2:16 pm
by feyd
I'm not sure what you're asking us. Is there a question?
Posted: Tue Mar 06, 2007 2:51 pm
by hrubos
Yeah,
who would show me a solve for a calendar in my form.
Thank in advance
Posted: Tue Mar 06, 2007 2:58 pm
by feyd
You want a calendar, that's it?
Have you searched for forums for "calendar" .. there's a few results.
Posted: Tue Mar 06, 2007 3:06 pm
by hrubos
Thank much your answer
But I don't need a normal calendar.
Beside poup calendar in java script, what any thing else, which I can chose date in this calendar and get this variable to do for command sql.
Posted: Tue Mar 06, 2007 3:19 pm
by feyd
Multiple drop-downs, text boxes..
Posted: Tue Mar 06, 2007 3:48 pm
by hrubos
I have done this, but I got a error : calendar.select :input object passed is not a valid form input object
This is my code :
Code: Select all
<html>
<body>
<FORM name="example" action="../admin/stu_lend.php" method="POST" >
<table border =1 bordercolor="#CC0033" cellspacing=0 cellpading=5>
<?php
db_connect();
$query = "SELECT DISTINCT id_thing,deposit,title,thing_store,place,time_interval
FROM things ";
$result = mysql_query($query)or die(mysql_error());
$num=mysql_numrows($result);
mysql_close();
$i=0;
while($i<$num){
$id_thing=mysql_result($result,$i,"id_thing");
$deposit=mysql_result($result,$i,"deposit");
$title=mysql_result($result,$i,"title");
$thing_store=mysql_result($result,$i,"thing_store");
$place=mysql_result($result,$i,"place");
$time_interval=mysql_result($result,$i,"time_interval");
?>
<tr>
<?php
echo "<td>$thing_store</td>";
echo "<td>$place</td>";
echo "<td>$deposit</td>";
echo "<td>$time_interval</td>";
echo "<td><div align= 'center'> <input type= 'radio' value = '$id_thing' name= 'id_numberRoom'></div></td>";
?>
<td>
<INPUT TYPE="text" NAME="date1" VALUE="" SIZE=10>
<A HREF="#"
onClick="cal.select(document.forms['example'].date1,'anchor1','MM/dd/yyyy'); return false;"
NAME="anchor1" ID="anchor1">vybrat</A>
</td>
<?php
echo "<td><div align= 'center'> <input type= 'radio' value = '$id_thing' name= 'id_numberRoom'></div></td>";
$i++;
}
echo "</tr></table>";
?>
<p></p>
<input type="submit" name="lend" value="Půjčit si">
</form>
<?php
bottom_title();
?>
</body>
</html>
Posted: Tue Mar 06, 2007 4:41 pm
by feyd
Your code does not have a "cal" object for javascript.
Posted: Tue Mar 06, 2007 5:31 pm
by hrubos
I have repaired :
Code: Select all
<html>
<head><SCRIPT LANGUAGE="JavaScript" SRC="../temp/js/CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var cal = new CalendarPopup();
</SCRIPT>
</head><body>
...............
..................
</body>
</html>
but I have given the same message error
Posted: Tue Mar 06, 2007 5:48 pm
by feyd
Are you sure "cal" is being created?
Posted: Tue Mar 06, 2007 6:19 pm
by Luke
you probably shouldn't have posted a new topic since this is basically the same as your last topic:
viewtopic.php?t=64486
Posted: Tue Mar 06, 2007 7:05 pm
by hrubos
The Ninja Space Goat wrote:you probably shouldn't have posted a new topic since this is basically the same as your last topic:
viewtopic.php?t=64486
I'm sorry. I posted it here because I think I have had problem with code PHP.
@feyd : I'm sure "cal" has been created in calendar.js