php in javascript
I have a form named "addappt".
I have two field that is "begintime" and "endtime".
Both are dropdown list. Thier value
format is "00:00". A time format.
My problem is, when i compare them,
there were no value.As you can see in line
number 7 below. Even when I display
them (begintime or endtime) using
document.write(begintime), it will display nothing.
How can i make this happen. Can anyone please
show me how to convert "begintime" and "endtime"
to numbers, or at least strip down
the ":" thing which is between them "00:00"
here. Or, how can i pass the value from the form which is already converted into number.
1 <script type="text/javascript">
2 function validate()
3 {
4 x=document.addappt
5 begintime=x.begintime.value
6 endtime=x.endtime.value
7 if (endtime < begintime)
8 {
9 alert("Invalid timeframe.")
10 return false
11 }
12 else
13 {
14 return true
15 }
16 }
17 </script>
__________________
$id ="waxxer";
$id = str_replace('x', 'l', $id);
echo $id;
echo " and Marj";
|