Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old January 25th, 2007, 06:05 PM
Jen
Guest
 
Posts: n/a
Default Replacing Text

Is it possible to do something like this with JavaScript?

If doc.Folder = "Select Doc Type"
Change doc.Folder to = "Journal Invoice"

I have been playing around with this, and just can't seem to get the
right syntax.

Thanks!

  #2  
Old January 25th, 2007, 06:25 PM
Lee
Guest
 
Posts: n/a
Default Re: Replacing Text

Jen said:
Quote:
>
>Is it possible to do something like this with JavaScript?
>
>If doc.Folder = "Select Doc Type"
>Change doc.Folder to = "Journal Invoice"
>
>I have been playing around with this, and just can't seem to get the
>right syntax.
What have you tried?


--

  #3  
Old January 25th, 2007, 07:15 PM
Jen
Guest
 
Posts: n/a
Default Re: Replacing Text



On Jan 25, 12:13 pm, Lee <REM0VElbspamt...@cox.netwrote:

What have you tried?

I have tried:
If doc.Folder = "Select Doc Type"
then doc.Folder = "AR Invoice";

var rename = doc.Folder

If rename = "Select Doc Type"
doc.Folder = "AR Invoice";

I am really not good at writing code, so I am sure that these aren't
even close to being correct.

  #4  
Old January 25th, 2007, 07:45 PM
TheBagbournes
Guest
 
Posts: n/a
Default Re: Replacing Text

Jen wrote:
Quote:
>
On Jan 25, 12:13 pm, Lee <REM0VElbspamt...@cox.netwrote:
>
What have you tried?
>
I have tried:
If doc.Folder = "Select Doc Type"
then doc.Folder = "AR Invoice";
>
var rename = doc.Folder
>
If rename = "Select Doc Type"
doc.Folder = "AR Invoice";
>
I am really not good at writing code, so I am sure that these aren't
even close to being correct.
Have you considered learning Javascript? It would help a lot.
  #5  
Old January 25th, 2007, 08:15 PM
Lee
Guest
 
Posts: n/a
Default Re: Replacing Text

Jen said:
Quote:
>
>
>
>On Jan 25, 12:13 pm, Lee <REM0VElbspamt...@cox.netwrote:
>
>What have you tried?
>
>I have tried:
>If doc.Folder = "Select Doc Type"
> then doc.Folder = "AR Invoice";
>
>var rename = doc.Folder
>
>If rename = "Select Doc Type"
>doc.Folder = "AR Invoice";
>
>I am really not good at writing code, so I am sure that these aren't
>even close to being correct.
I wouldn't say you're not good at writing code.
What you're really bad at seems to be research.

The Javascript "if..else" syntax is described here:
http://docs.sun.com/source/816-6408-10/stmt.htm#1004833

The comparison operators are here:
http://docs.sun.com/source/816-6408-10/ops.htm#1060974


if ( doc.Folder == "Select Doc Type" ) {
doc.Folder = "AR Invoice";
}


--

  #6  
Old January 25th, 2007, 08:15 PM
Evertjan.
Guest
 
Posts: n/a
Default Re: Replacing Text

Lee wrote on 25 jan 2007 in comp.lang.javascript:
Quote:
>
if ( doc.Folder == "Select Doc Type" ) {
doc.Folder = "AR Invoice";
>}
>
Or:

doc.Folder =
doc.Folder.replace(/^Select Doc Type$/,'AR Invoice';





--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,248 network members.