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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS to fill a textbox array with a textbox value -- Similar to Adwords

Status
Not open for further replies.

GuiJockey

IS-IT--Management
Joined
Sep 15, 2003
Messages
1
Location
US
Need help writing a javscript that is similar to Adwords interface:

Please see the screenshot at


As you can see, by pressing the 'V' button, it fills up the rest of the textboxes below with the value from the first textbox.

Any pointers? Help appreciated. Thanks!
 
Can you post the code you have to create the interface, as well as any code you've written to try to duplicate the values?

That way, we'll have more to go on, and so can base answers on your existing code, rather than giving you something you may have to modify extensively.

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
OK, what exactly is the project that you are trying to apply this to?

Not knowing your exact useage here, I can generally say that you could use something like:
Code:
<form name="f1" action="." method=post>
Type something here:<input name="master" type=text><br>
Then press this button:<input type=button name="transfer!" value="Transfer!" onClick="var data = document.f1.master.value; document.f1.slave.value = data; return false;"><br>
And what you typed there will appear here:<input name="slave" type=text>
</form>

Granted, this is a very basic example of the function, and I would almost always recommend writing a JavaScript function in either a separate (so you can re-use it between pages), linked .js file, or inside [tt]<script language="JavaScript">...</script>[/tt] tags in the head of the same page. That way you could just call the separate function in your [tt]onClick=""[/tt], instead of having to insert several lines of JS there.

If you need more specific guidance here, please give us more details on what exactly you are trying to accomplish here, and, in any case, please reply and let us know if it did/did not solve your problem for you. Thanks.


I hope this helps;
Rob Hercules
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top