Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 06-17-2005, 09:09 PM php in javascript
waller's Avatar
Skilled Talker

Posts: 59
Location: North Borneo.
Trades: 0
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";
waller is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-18-2005, 01:45 AM
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
This problem has nothing to do with PHP. Go to JavaScript forum.

BTW, you refer to your form incorrectly. You should do
x = document.forms['addapt']
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to php in javascript
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.53951 seconds with 12 queries