Alert messages using javascript

Hi all ,I have this question. I dont know if this has a solution though!!

I have a “rich text field” and “file upload” control to upload my coverletter and resume respectively.

Now when user enters some data in these fields,its fine …but when she does not enter any data and submits the form, i want to display an alert message like “Please enter cover letter /resume to proceed”

This is possible with a text field in a form with the following code:

if(document.forms[0].fieldname.value == “”) {

        alert(" Please enter a value in the field to continue");

       return false;

        }

else return true;

I want to have the same effect with my rich text field and fileupload control.

But the following code does not work:

if(document.forms[0].RICHTEXTFIELD.value == “”) {

        alert(" Please enter a coverletter to continue");

        return false;

        }

else return true;

and neither does the following :

if(document.forms[0].FILEUPLOADCONTROL.value == “”) {

        alert(" Please enter a resume to continue");

        return false;

        }

else return true;

Any solutions will be greatly appreciated.

thank you.,

J

Subject: alert messages using javascript

Assign your rich text field and fileupload control an id; refer to the HTML tab of the field properties dialog box. Then you can use the the following successfully:document.getElementById(“xxx”).value

where “xxx” is the id you have assigned.

An Example I use for a file upload control which has an HTML Id of “file”:

function validate () {

var filename = document.getElementById(“file”).value;

if (filename == “”) {

alert(“Please select a file.”);

	   document.getElementById("file").focus();

return false;

}

return true;

}