Hello...
Can I ask questions from you guys?
Here is my sample code in PHP:
<!--Calendar configuration-->
<style type="text/css">@import url("jscalendar-1.0/calendar-blue2.css");</style>
<script type="text/javascript" src="jscalendar-1.0/calendar.js"></script>
<script type="text/javascript" src="jscalendar-1.0/lang/calendar-en.js"></script>
<script type="text/javascript" src="jscalendar-1.0/calendar-setup.js"></script>
<script type="text/javascript" src="javascript2/sugar.js"></script>
<script type="text/javascript" src="javascript2/security.js"></script>
<?php
$a = 0;
while($a<=3){
?>
<table width="75%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td>Date</td>
<td>Shift</td>
</tr>
<tr>
<td>
<input type="text" name="date_range<?=$a?>" id="date_range<?=$a?>" tabindex='1' size='11' maxlength='11' value="">date_range<?=$a?>
<img src="images/calendar.png" alt="Date" id="grace<?=$a?>" align="absmiddle">
<script type="text/javascript">
Calendar.setup (
{
inputField : "date_range<?=$a?>", // ID of the input field
ifFormat : "%Y-%m-%d", // the date format
button : "grace<?=$a?>" // ID of the button
}
);
</script>
</input>
</td>
<td><input type="text" name="input[]" id="input[]" tabindex='1' size='11' maxlength='11' value=""></input></td>
</tr>
</table>
<?
$a++;
} ?>
Question:
Easy:
1.) with all of these field arrays, what best code can I use to get all of the values inputed by the user? (example: get the value of date_range[1])
Hard:
Rule:
a.) if the user will add data on the date textbox, the user must also put data at the shift texbox.
Question :
1.) what code must I use to check the input of the date textbox and the shift textbox? (if the date_range[0] has a data, then input[0] must also have a data from the user)
Example :
if (!date_range[0] =="")
then input[0] must not be empty
else: Message box: missing data needed for input[0]
2.) What code is better for this approach for this error handler? PHP or Javascript?
Thank you very much...
I hope someone can help me through this....
GRace