> If you take your car into a mechanic's, do you tell him or her that it's
broke and then leave?
IOW, post testable code or a URL. :)
--
--
~kaeli~
A little rudeness and disrespect can elevate a meaningless
interaction to a battle of wills and add drama to an
otherwise dull day.
Hi Kaeli.
Good point... but usually I give a vague indication to the guy or gal then I
leave. I'm no mechanic. :-)
OK. A brief description (ie. vague indication :-)...
Clicking on a button on a form fills in the read only text fields which
contain a date. The reason why they're read only is that I want the user to
click on the button to enter the date and not try and enter it manually
(thus requiring more validation than necessary). The problem is that the
date is mandatory if they select "Yes" to a previous field and I need to
check to see if a date has been entered before allowing them to proceed. I
suppose I could use a hidden field but I believe this should work too.
Here is snippets from the code to look at.
I have a form named "advice" and I have the following within the body of the
HTML.
....
<td class="rowColour1">
Dated:
<input type="text" name="CIRDateDay" id="CIRDateDay" value="" size="2"
readonly="true">/
<input type="text" name="CIRDateMonth" id="CIRDateMonth" value=""
size="2" readonly="true">/
<input type="text" name="CIRDateYear" id="CIRDateYear" value=""
size="4" readonly="true">
<input class="button" type="button" name="CIRDate" id="CIRDate"
value="Calendar" onClick="showCalendar();">
</td>
....
Clicking on the button will bring up the Calendar and from the selection
fill in CIRDateDay, CIRDateMonth & CIRDateYear, each of which is read only.
In the head of the HTML I have the following to check that something is in
there before proceeding to the next page:
....
if ((advice.CIRDateDay.value != "") &&
(advice.CIRDateMonth.value != "") &&
(advice.CIRDateYear.value != "")) {
// Show the values and set OK to advance
alert("1. Day Month Year = >" + advice.CIRDateDay.value + "< >" +
advice.CIRDateMonth.value + "< >" + advice.CIRDateYear.value +"<");
} else {
alert("A date must be entered for when the previous Statement of Advice
was entered.");
}
....
Running this brings back an alert box containing:
1. Day Month Year = >undefined< >undefined< >undefined<
I hope this enough info... oh, and can I have the brakes replaced as I find
it doesn't stop in time and the insurance company is after me. :-)
Thanks Kaeli.