Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string Contenation

Status
Not open for further replies.

deejayAr

Technical User
Mar 20, 2008
126
US
I writing string that use for query in javascript
and
needs to end up ("apples" OR "tree fruit")
what is the best way to write in java script

thanks
 
title supposed to be String concatenation
 
Well you use the "+" sign in JS to concatenate.

So:

var mystring="...." + "apples";

or
var mystring="...." + "free fruit";

I hope that's what you are asking.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
this is part I need string concatenation

else if (selElem.value == "2")
{document.actionform1.DropDown1.value="(Apple OR Tree Fruit)" ;}

needs out put
("apples" OR "tree fruit")
but it + operator does not work
 
Assuming you are trying to add the entire phrase (Apples Or Tree Fruit" to the existing value of Dropdown1 then do this:
Code:
document.actionform1.DropDown1.value[red]+[/red]="(Apple OR Tree Fruit)" ;}



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I like to have out put like
("apples" OR "tree fruit")
instead of
"(apples OR tree fruit)"


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top