Click here to Skip to main content
15,885,182 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i am vaidation filepath using javascript
my code is

C#
var pathX = "[?:[\w]\:|\\)(\\[a-z_\-\s0-9\.]+]+\.(?:.xml)$";
           var Filepath = document.getElementById('<%=txtFolderPath.ClientID %>').value;
           var matchArray = Filepath.match(pathX);
           if (matchArray == null) {

               alert("Please Enter Valid FilePath");
               document.getElementById('<%=txtFolderPath.ClientID %>').focus();
               return false;
         }



but is not validating to any path
can any one help regarding this
Posted
Updated 2-Jul-13 1:05am
v2
Comments
ZurdoDev 2-Jul-13 7:59am    
Why are you validating a path?
Manohar_manu 2-Jul-13 8:02am    
i want to display xml from that path
ZurdoDev 2-Jul-13 8:04am    
I still don't understand. Are you wanting to open a file?
Manohar_manu 2-Jul-13 8:20am    
i am giving a textbox in that user will enter a xml file path

i am checking that filepath in javascript
in web application
ZurdoDev 2-Jul-13 8:22am    
I know, but why? The reason I ask is because you cannot browse the file system on the client. It's a security issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900