0

/t5/coldfusion-discussions/problem-with-using-disabled-form-elements/td-p/822452
May 03, 2006
May 03, 2006
Copy link to clipboard
Copied
Say I have a simple form with a file input element and a
submit button.
When I hit submit I want to disable the file input so I call a javascript function on the 'onClick' event to do this.
The problem is when the javascript disables the file input, then subsequently Coldfusion cannot use the value of the file input to upload the file as it doesn't think it exists....
Anyone know an easy way around this?
Thanks
)
When I hit submit I want to disable the file input so I call a javascript function on the 'onClick' event to do this.
The problem is when the javascript disables the file input, then subsequently Coldfusion cannot use the value of the file input to upload the file as it doesn't think it exists....
Anyone know an easy way around this?
Thanks

Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
It was a user requirement to disable form elements while a
file was being uploaded.
I have disabled the submit button using a hidden field as suggested. This should be sufficient as even if a user searches for another file to upload, they cannot subit the form.
Thanks for you help...
I have disabled the submit button using a hidden field as suggested. This should be sufficient as even if a user searches for another file to upload, they cannot subit the form.
Thanks for you help...
Advocate
,
/t5/coldfusion-discussions/problem-with-using-disabled-form-elements/m-p/822453#M76125
May 03, 2006
May 03, 2006
Copy link to clipboard
Copied
No, because disabled form fields aren't submitted, and you
can't call
form.submit()
then have javascript after this that's executed.
What are you trying to accomplish? Why do you want to disable the file input?
form.submit()
then have javascript after this that's executed.
What are you trying to accomplish? Why do you want to disable the file input?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/problem-with-using-disabled-form-elements/m-p/822454#M76126
May 03, 2006
May 03, 2006
Copy link to clipboard
Copied
Add a hidden field to your form. In your js, give it whatever
value was in your disabled field.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Advocate
,
/t5/coldfusion-discussions/problem-with-using-disabled-form-elements/m-p/822455#M76127
May 03, 2006
May 03, 2006
Copy link to clipboard
Copied
Note that doing what Dan suggests with a File input field
won't work.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/coldfusion-discussions/problem-with-using-disabled-form-elements/m-p/822456#M76128
May 04, 2006
May 04, 2006
Copy link to clipboard
Copied
It was a user requirement to disable form elements while a
file was being uploaded.
I have disabled the submit button using a hidden field as suggested. This should be sufficient as even if a user searches for another file to upload, they cannot subit the form.
Thanks for you help...
I have disabled the submit button using a hidden field as suggested. This should be sufficient as even if a user searches for another file to upload, they cannot subit the form.
Thanks for you help...
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

