Please help me figure out what the problem is with this code:
The second line is where the browser knit-picks a problem with an "Unterminated String Constant" error. I've tried
The code is supposed to change all the "\" to "/" and place the string into a hidden text box within the same form. The string originates from a FILE input.
I've tried for hours to find a solution to the problem by searching the internet, but I can't seem to get a break on this one. Any constructive reply is welcome, and thanks.
Code:
var s1=document.f.b.value; var s1=s1.replace(/\/gi,"/"); document.f.p.value=s1;
var s1=s1.replace(/\//gi,"/");
, with and without the "i" and "gi". The highlighted code ends the error popup, but it still doesn't work. (I suspect that it's trying to replace all instances of "\/", which there isn't any in a normal file path.)The code is supposed to change all the "\" to "/" and place the string into a hidden text box within the same form. The string originates from a FILE input.
I've tried for hours to find a solution to the problem by searching the internet, but I can't seem to get a break on this one. Any constructive reply is welcome, and thanks.
Comment