yo yo
can we validate the <INPUT TYPE="FILE">?
WHILE UPLOADING A FILE I NEED TO RESTRICT THE USER FROM ENTERING TEXT DIRECTLY IN THE TEXT FIELD AND SOME FILE VALIDATION HAS TO BE DONE
help me out in handling
yo yo
can we validate the <INPUT TYPE="FILE">?
WHILE UPLOADING A FILE I NEED TO RESTRICT THE USER FROM ENTERING TEXT DIRECTLY IN THE TEXT FIELD AND SOME FILE VALIDATION HAS TO BE DONE
help me out in handling
Hi Pradeeh,
You can restrict the user entering file name directly to the textbox by writing a Keypress event as
Script
<script language="javascript" >
function onkeyPress(e)
{
var key = window.event ? e.keyCode : e.which;
if (key == 13)
StartClick();
e.cancelBubble = true;
e.returnValue = false;
return false;
}
</script>
Html
<input id="File1" style="position: relative" type="file" onkeypress="return onkeyPress(event);">
Can u be still clear on the other validation to be done.
Regards,
Valli
(www.syncfusion.com)
ASP.Net FAQ:
http://www.syncfusion.com/faq/aspnet/default.aspx
Complete set of ASP.Net controls and components
http://www.syncfusion.com/toolsweb
Valli
It ought to be done server-side. And what kind of validation are you talking about?
PHP FAQ:
http://www.php.net/FAQ.php
Complete set of PHP functions
http://www.php.net/manual/en/funcref.php
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
valli
my requirement is that the use sudn't even enter a valida path. he has options only to select a file and on uploading [clicking the button] it has to check whether a file is been selected.
Twey
NO SERVER_SIDE VALIDATION...
PraDheep
Whoa, huh?my requirement is that the use sudn't even enter a valida path.
Note that whatever you want for this validation, you'll still need something serverside to recieve the file, so... sure, add a user friendly thing that will stop them from wasting with, with javascript, but you should also add something more secure (javascript can be gotten around) serverside to check the file then as well.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Then you're wasting your time. Why can you not use server-side validation? As djr33 says, you must already be using a server-side script, or your form won't do anythingTwey
NO SERVER_SIDE VALIDATION...There's not really much you can do. The file input is a rather unstandardised element, and although it usually manifests itself as the popular textbox and button, it doesn't have to according to the standards. It offers virtually no control over itself.he has options only to select a file and on uploading [clicking the button] it has to check whether a file is been selected.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Plus, you won't have access to the person's computer to check if the file does exist... so... yeah.
And, again, don't you want secure? The only way IS server side.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Well, actually there is a "tricky" way to style file inputs.
Check out this: http://www.quirksmode.org/dom/inputfile.html
Ah, clever![]()
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Thanks all 4 posting and solving my issues and thanks for DimX who show the styles of input type file.
PraDz
Bookmarks