Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: 3 in 1 javascript problems


Message #1 by andy@a... on Tue, 15 May 2001 12:28:28
Hi Andy,

At 12:28 15/05/01 +0000, you wrote:
>Hi
>
>3 questions if I may
>
>1. Why does javascript treat "\\ukerp01\global_erp"
>as "\ukerp01global_erp" stripping out 2 "\"'s.

When you include certain characters, including \ in a string, you must, 
like in languages such as c & perl, escape the character. This is done by 
placing a \ before the character in question. Basically, this tells the 
javascript interpreter that you actually want the character following the \ 
to be treated as such, rather than for it to be processed as an operator.

So, in this case, the escaped string "\\\\ukerp01\\global_erp" should come 
out as "\\ukerp01\global_erp"


>2. Why does the onchange not work with input type set to "file"

According to this, it will, but suprise suprise, for IE only:-

"Netscape 2+ only supports the onChange event handler attribute in cases 
where the user enters or modifies text via the text box; if the "Browse..." 
button is the only thing used, the event is not fired. Internet Explorer 
4.0+ fires the event in both cases."

http://www.blooberry.com/indexdot/html/tagpages/i/inputfile.htm


>3.How do I write this value back into a txt box on a form.

As the page above explains (at the bottom), if you are trying to 
programmatically get the value of the file textbox after the user has 
browsed for a file, this is impossible.

Cheers,

Ben


>Thanks in advance
>
>Andy Green
>

  Return to Index