User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 425,773 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,336 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 3600 | Replies: 14 | Solved
Reply
Join Date: Sep 2006
Posts: 90
Reputation: scorpionz is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster in Training

Re: How to get Id of Div

  #11  
May 28th, 2008
Hi Thanks Luck For Understanding a problem and shares a time ....

But well the Code is really not working at all
Even I separate them in Different Div Tags....
and as Far as Previous Issue is Concerned.... that also not working like i said IF i click href then it calls get_val() function and copy send that Text 1 value to text 2 and show it there
and even if i edit some thing in text 1 and thus after clicking on href it sends to Text 2

I hope it will more clear scenario, and I have make a little change in design as Well, Hop it looks cool to understand

<html>
<head>

<script type="text/javascript">
function get_id()
{
var divEls = document.getElementsByTagName("div");
var textEl = document.getElementById("mytextarea");
var i = 0;
for(i=0;i<divEls.length;i++) {
//alert(divEls[i].id);
textEl.value = divEls[i].id;
}
}

function get_val()
{
//var hre = document.getElementsByTagName("src");

var text1 = document.getElementsById("mytextarea");

var text2 = document.getElementsById("mytextarea2");

text1.value=text2.value;

}


</script>

</head>
<body>

<div style='border-width:1px;border-color:#C0C0C0;border-style: solid;background-color:#C0C0C0;width:380px;'>
<textarea id="mytextarea"> </textarea>

<textarea id="mytextarea2"> </textarea>
</div>
&nbsp;
<div id="mydiv" onclick="get_id()" style='border-width:1px;border-color:#C0C0C0;border-style: solid;background-color:#C0C0C0;width:130px;'>
<a href="#" id="src" onclick="get_val()">ScorpionZ</a>
</div>

</body>
</html>

after all Thanks for you time once again, Hoping for more...
Reply With Quote  
Join Date: Aug 2006
Location: Noida, India
Posts: 158
Reputation: Luckychap is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 17
Luckychap's Avatar
Luckychap Luckychap is offline Offline
Junior Poster

Re: How to get Id of Div

  #12  
May 28th, 2008
I m sorry I did little mistake changing the get_val() function:

function get_val()
{

var text1 = document.getElementsById("mytextarea");

var text2 = document.getElementsById("mytextarea2");

//text1.value=text2.value;  That was wrong
text2.value=text1.value;


}

Last edited by Luckychap : May 28th, 2008 at 1:42 am.
When you think you have done a lot, then be ready for YOUR downfall.
Reply With Quote  
Join Date: Sep 2006
Posts: 90
Reputation: scorpionz is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster in Training

Re: How to get Id of Div

  #13  
May 28th, 2008
Thanks a lot Lucky

But aha!!! One more mistake that we are doing here is that

I was using
documents.get....
so s was making problem
that is get invisible for us

Well But No doubt Its Done
Remarkably

Thanks a Lot once again
and ha do u have any idea regarding
Div Box moving around Browser, I started one of the thread regarding this, but not much feedback for me....
I make an demo but it was a browser problem at the end
the thing that i am doing is i move a div box using mouse and shows its position and where i stop it, it just shows (x,y) coordinates there....
do u have idea about that.... here is the link about that thread:
http://www.daniweb.com/forums/post61...tml#post613636

Once again Thanks

Regards
Scorpionz
Reply With Quote  
Join Date: Aug 2006
Location: Noida, India
Posts: 158
Reputation: Luckychap is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 17
Luckychap's Avatar
Luckychap Luckychap is offline Offline
Junior Poster

Re: How to get Id of Div

  #14  
May 28th, 2008
Why are not using YUI thats good, i have used it thats work fine: http://developer.yahoo.com/yui/examp...rop/index.html
When you think you have done a lot, then be ready for YOUR downfall.
Reply With Quote  
Join Date: Sep 2006
Posts: 90
Reputation: scorpionz is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster in Training

Re: How to get Id of Div

  #15  
May 28th, 2008
Hi Big Thanks Now i am Posting the message regarding this Topic on new that thread....
Lets have a discussion there
......
http://www.daniweb.com/forums/thread125865.html

Hope Will Not Problem for You

Regards
Scorpionz
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 2:48 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC