Re: Re: Having an alert box come up if a field in a form is filled in
- There's a couple of stray characters. Also, the use of "document" here is
incorrect. The function definition should read:
if(form.upLoadFile.value != "")
value = confirm("You're about to overwrite the existing file. Continue?");
In this function:
form -> the form from which the function is called
form.upLoadFile -> the form input "upLoadFile"
form.upLoadFile.value -> the value of that form input
if(form.upLoadFile.value != "")... -> if the form input named "upLoadFile" is
Replace "upLoadFile" with the actual name of the file upload input.
The form does not need to be named in order for this function to work. Using
"this" in the function call takes care of that. When called from an event
handler, "this" means "this element" or "the element from which this function is
> From: Marian Briones <mbriones@...>
> Subject: Re: Re: Having an alert box come up if a field in a form is filled in
> I did this:
> function check(form)";
> if(form.document.value != "")
> value = confirm("You're about to overwrite the existing file. Continue?");
> return value;
> I don't want to validate an incoming file; that already happens when
> they first add an uploaded document.
> This isn't working. I put the onsubmit checkform and it isn't working.
> <FORM ACTION="/usmsadmin/minutes/add_minutes.php" METHOD="POST" ENCTYPE="multipart/form-data" onsubmit="return checkOverwrite(this);" NAME="form">
> what can I do?
> There's a couple of stray characters. Also, the use of "document" here isWhat Jon is referring to is that the word "document", in browser
this. His example is a good one.