Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Ezilon Directory   High Bandwidth Dedicated Servers   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 02-25-2007, 09:40 PM   #1 (permalink)
Inactive
 
Join Date: 02-25-07
Posts: 4
iTrader: 0 / 0%
Latest Blog:
None

Xster is liked by many
Does anyone know how to fix this?

Im strunggling to validate each input box that my senior made and
I dont know how to figure it out..any help would be appreciate!

TQ in advance! u guys rock!

Code:
<html> <head> <title><?php echo $row_rs1['title']; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="../pnec.css" rel="stylesheet" type="text/css"> <Script language="JavaScript"> // this section im very confuse function checkForm() { var timeFrom, timeFrom1, timeTo, timeTo1; with(window.document.msgform) { ctime1 = timeFrom; ctime2 = timeFrom1; ctime3 = timeTo; ctime4 = timeTo1; } if(trim(ctime1.value) == '') { alert('Please enter your time from'); ctime1.focus(); return false; } else if(trim(ctime2.value) == '') { alert('Please enter your time from'); ctime2.focus(); return false; } else if(trim(ctime3.value) == '') { alert('Please enter your time to'); ctime3.focus(); return false; } else if(trim(ctime4.value) == '') { alert('Please enter your time to'); ctime4.focus(); return false; } else { ctime1.value = trim(ctime1.value); ctime2.value = trim(ctime2.value); ctime3.value = trim(ctime3.value); ctime4.value = trim(ctime4.value); return true; } } function trim(str) { return str.replace(/^\s+|\s+$/g,''); } </script> </head> <body> Welcome, <?php echo "".$_SESSION['username'];?>!</td> <td> <img src="../frontpage-user/ec-layout-user-e5_23.gif" width="17" height="22" alt=""></td> </tr> <!-- ****************************************8Dropdown menu*******************************************8 --> <tr> <td colspan="9"></td> </tr> <tr> <td></td> <td colspan="7"> <table border="0" cellpadding="2" cellspacing="0" bgcolor="#FBE7C5"> <tr> <td><div class="page_title_user"><font color="#9ACEDF">..</font> <font color="#6FB7D6">::</font> my Facilities Booking <font color="#6FB7D6">::</font><font color="#9ACEDF">..</font> </div></td> </tr> <tr bgcolor="#D6EDF0"> <td><div style="font-size:14px;" align="center"> Be mesmerized with the convenience of online facilities booking of community hall, badminton court, tennis court and other facilities provided for in the community. </div></td> </tr> <tr> <td> <?php if(!isset($_POST['submit'])){ ?> <form action="" method="post" onSubmit="return (checkForm());"> <table width="98%" height="301" border="0" class="body" align="center" cellpadding="10" cellspacing="0" bordercolor="#FFFFFF"> <!--Step 3 : Select Time--> <tr> <td style="border-width:1px; border-color:#A8B2C6; border-style:solid;" class="body" colspan="2"> <div style="font-size:18px; color:#007E8C; font-weight:bold;"> <font color="#cccccc">3. </font>Select Time</div> <br> </td> </tr> <tr> <td width="15%" class="body-facilities">From:</td> <td class="body-facilities">&nbsp; <input type="text" name="timeFrom" class="body" id="timeFrom" size="1" maxlength="2"> &nbsp;:&nbsp; <input type="text" name="timeFrom1" class="body" id="timeFrom1" size="1" maxlength="2"> &nbsp;<sup style="color:#FF0000">eg: 08:00</sup> </td> </tr> <tr> <td class="body-facilities">To:</td> <td class="body-facilities">&nbsp; <input type="text" name="timeTo" class="body" id="timeTo" size="1" maxlength="2"> &nbsp;:&nbsp; <input type="text" name="timeTo1" class="body" id="timeTo1" size="1" maxlength="2"> &nbsp;<sup style="color:#FF0000">eg: 23:00</sup></td> </tr> <tr> <td class="body-facilities"><sub>Operating Hour:</sub></td> <td class="body-facilities"><sub><?php echo $row_rs['fac_wkdayS'];?>&nbsp;to&nbsp;<?php echo $row_rs['fac_wkdayE'];?>&nbsp;(Monday to Friday)</sub><br> <sub><?php echo $row_rs['fac_wkendS'];?>&nbsp;to&nbsp;<?php echo $row_rs['fac_wkendE'];?>&nbsp;(Saturday &amp; Sunday)</sub></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="submit" value="Next" class="button"> &nbsp;&nbsp; <input type="reset" name="reset" value="Reset" class="button"> &nbsp;&nbsp; </td> </tr> </table> </form> <?php } ?> </td> </tr> </table> </body> </html>
Xster is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 02-26-2007, 06:05 AM   #2 (permalink)
Contributing Member
 
Nicole's Avatar
 
Join Date: 02-23-07
Location: USA
Posts: 874
iTrader: 0 / 0%
Nicole is a glorious beacon of lightNicole is a glorious beacon of lightNicole is a glorious beacon of lightNicole is a glorious beacon of lightNicole is a glorious beacon of lightNicole is a glorious beacon of lightNicole is a glorious beacon of lightNicole is a glorious beacon of lightNicole is a glorious beacon of lightNicole is a glorious beacon of lightNicole is a glorious beacon of light
Can you give more information?

Exactly what is supposed to happen and exactly what does happen?
__________________
~Nicole

V7N Contextual Links
Nicole is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-26-2007, 12:08 PM   #3 (permalink)
Contributing Member
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,067
iTrader: 0 / 0%
Latest Blog:
Moved In!

Izzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to behold
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
So, is there a problem with this script? Is the JavaScript not validating correctly all of the time inputs?
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-26-2007, 06:22 PM   #4 (permalink)
Inactive
 
Join Date: 02-25-07
Posts: 4
iTrader: 0 / 0%
Latest Blog:
None

Xster is liked by many
Quote:
Originally Posted by Jaseva View Post
Can you give more information?

Exactly what is supposed to happen and exactly what does happen?

Its suppose validate the time each input box whether using correct time format or not before going to confirmation form. My validation does not work and I need some advice frm u guys. Btw, Im freaking new about this PHP and JavaScript

TQ.
Xster is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-26-2007, 06:24 PM   #5 (permalink)
Inactive
 
Join Date: 02-25-07
Posts: 4
iTrader: 0 / 0%
Latest Blog:
None

Xster is liked by many
Quote:
Originally Posted by Izzmo View Post
So, is there a problem with this script? Is the JavaScript not validating correctly all of the time inputs?
Yes, sir. TQ
Xster is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-26-2007, 06:24 PM   #6 (permalink)
Inactive
 
Join Date: 02-25-07
Posts: 4
iTrader: 0 / 0%
Latest Blog:
None

Xster is liked by many
Quote:
Originally Posted by Izzmo View Post
So, is there a problem with this script? Is the JavaScript not validating correctly all of the time inputs?
Yes, sir. TQ for asking.
Xster is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 05:34 AM.
© Copyright 2008 V7 Inc