I'm creating a share folder request form. I have a text field that needs to have slashes in it for the directory. Ex: \\ServerName\Folder1\Folder2\
Is there any way to be able to do this. Basically I want the users to be able to copy and paste the UNC path to the directory they need access to without having to do anything extra.
Thanks in Advance,
Ryan D.
Hi Ryan,
Can you explain a bit more about how you're creating the path for the directory?
Are you creating the path dynamically when a user makes a selection in the form or some other method?
If you're using the built in field calculations you can set it to be stored as text and add the slashes in to the 'calculation'.
For example, if you set the default value for a field to be:
[123]\[124]\[125]\[126]
Then it will be populated with the values of fields 123, 124, 125 & 126 separated by slashes.
Hope that helps
Chris
Not dynamic, literally just copying the folder path and pasting into the field or typing it out. I understand that PHP/HTML strips out the slashes, just trying to see if there is a way to keep them in.
when a user copies \\ServerName\FolderPath it sends the data as \SeverNameFolderPath. If I add \\\\ServerName\\FolderPath that works, but I don't want to have the users remember to add the extra slashes.
Hi Ryan,
Ok i see. There are a couple of ways you can do this but i would probably use the frm_validate_field_entry hook to change all single \ to double \\ when the submit button it clicked and before the value is saved to the DB.
Off the top of my head you'll probably want to use preg_replace or str_replace but it might require a bit of experimenting to find the right method as you'll have a mixture of single and double slashes to replace for most paths.
Thanks. I'll see what I can come up with. My PHP is a little rusty, might take me a while.
Please login or Register to submit your answer