-
Load content in a div by clicking on another div. How?
I have content in one div that I want to simply transfer to another div when I click on the entire div element.
Also, I'm wondering how I can transfer content in a div to a form textfield box.
Anybody have any ideas?
Thanks a lot! I really appreciate it!
-
Hi,
I have written some code which might be helpful to you.
----------------------------------------------------------------
<script>
function transfertext(FrmName,div01,div02,mytext01) {
var div1 = document.getElementById(div01);
var div2 = document.getElementById(div02);
var Field = eval("document." + FrmName + "." +mytext01);
div2.innerHTML = div1.innerHTML;
Field.value = div1.innerHTML;
}
</script>
<form name="myform01">
<div id="mydiv01" onClick="transfertext('myform01','mydiv01','mydiv02','mytext01');">My first text</div>
<div id="mydiv02">My Second text</div>
<input type="text" value="" name="mytext01">
</form>
-------------------------------------------------------------------------
Jayant Patil
Mumbai
-
Thanks for that code you provided for the other guy. It became of great use to me!
-
You are welcome!
Similar Threads
-
By ootnitsuj in forum VB Classic
Replies: 7
Last Post: 02-24-2006, 11:56 AM
-
Replies: 1
Last Post: 06-25-2005, 01:30 AM
-
By shapper in forum ASP.NET
Replies: 0
Last Post: 04-21-2005, 07:32 AM
-
Replies: 2
Last Post: 03-16-2001, 09:56 AM
-
By Ning in forum Database
Replies: 0
Last Post: 03-14-2001, 02:03 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks