473,386 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

type a string save it as a variable and then add it to another string

25
hello, could you help me please solve this problem?
I need to make a form with just one text field, but javascript will save that typed string into that text field as a variable 'X'. After clicking a form button, it should open the google search page with searching the following "Alino is watching 'X' haha"
So if user has typed "blablabla" it should open the google search with this query in it "Alino is watching blablabla haha".
Feb 19 '10 #1

✓ answered by larztheloser


3 1550
gits
5,390 Expert Mod 4TB
you might use the replace() method for such a purpose:

Expand|Select|Wrap|Line Numbers
  1. var s = "Alino is watching X haha";
  2. var newTextForX = 'foo';
  3.  
  4. alert(s.replace('X', newTextForX);
kind regards
Feb 21 '10 #2
You might also want to check out http://code.google.com/apis/customsearch/docs/api.html
Feb 21 '10 #3
Alino
25
thank you, this was very useful information.
Feb 21 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
4
by: john bailo | last post by:
For a c# program to automatically extract information from email attachments using the Outlook 9 OM, rather than saving to a file, then reading the file, I would prefer to 'Save' the attachment to...
7
by: Jack | last post by:
Hi, I am trying to test a sql statement in Access which gives me the error as stated in the heading. The sql statement is built as a part of asp login verification, where the userid and password...
6
by: Charles Law | last post by:
I want to do something like this: obj = CType(value, Value.Type) Well, not exactly, but I think that captures the essence. I realise it won't work as I have written it, and it looks a bit like...
5
by: Erol | last post by:
How do I get a type from a string? I'm retrieving a string value from my database so that I can set my property values dynamically. In the event "Form1_Load", you will see that I'm trying to set...
11
by: JohnR | last post by:
I'm trying to find a way to create a variable of a given type at runtime where I won't know the type until it actually executes. For example, dim x as object = "hi" x is declared as an object...
9
by: Savas Ates | last post by:
Dim ProductPropertyValues_Value as string ProductPropertyValues_Value = xx("ProductPropertyValues_Value") it returns error.. Because xx("ProductPropertyValues_Value") returns NULL or ""...
17
by: The Frog | last post by:
Hello everyone, I am working on an application that can build database objects in MS Access from text files. I suppose you could call it a backup and restore type routine. Accessing the...
9
by: Prateek | last post by:
I have a bit of a specialized request. I'm reading a table of strings (specifically fixed length 36 char uuids generated via uuid.uuid4() in the standard library) from a file and creating a set...
2
by: nicstel | last post by:
Hello, I'm trying to find documentation about the xlwt (py_excelerator). I want to change the border of some cells. But the only types that I found is: double and dashed. How to do a simple line...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.