<SPAN> help

This is a discussion on "<SPAN> help" within the JavaScript Forum section. This forum, and the thread "<SPAN> help are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 3rd, 2007, 03:54
New Member
Join Date: Nov 2007
Location: USA
Age: 35
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
<SPAN> help

Hi,

I have a group of values, basically its words and their synonyms. The “word” and it’s “synonym” have the same ID.
I’m creating it using <SPAN> like this, so it looks like a hyperlink.

FAST <span onclick="AddToContainer(‘1’)" style="cursor:hand;color:blue;text-decoration:underline">FAST</span>

WHILD<span onclick="AddToContainer(‘2’)" style="cursor:hand;color:blue;text-decoration:underline">WHILD</span>

QUICK<span onclick="AddToContainer(‘1’)" style="cursor:hand;color:blue;text-decoration:underline">QUICK</span>

SUNNY<span onclick="AddToContainer(‘3’)" style="cursor:hand;color:blue;text-decoration:underline">SUNNY</span>

PERFECT<span onclick="AddToContainer(‘4’)" style="cursor:hand;color:blue;text-decoration:underline">PERFECT</span>

BRIGHT<span onclick="AddToContainer(‘3’)" style="cursor:hand;color:blue;text-decoration:underline">BRIGHT</span>



I also have a SPAN called spContainer: <span id="spContainer" runat="server" />

What I need to do is upon clicking on each word add it to span container.
I also need to make it disable(not clickable) together with it’s synonym(s).
For example I click on FAST making it disabled, and at the same time make it’s synonym QUICK also disabled.

I need some help with JavaScript function AddToContainer.

Thank you
Reply With Quote

  #2 (permalink)  
Old Nov 3rd, 2007, 15:47
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <SPAN> help

Okay, so I can see a few problems here.

First and foremost, you cannot have two elements on the same page with the same ID, this is completely against the DOM -- ID should be unique.

I can think of a few things to help you but I'm not entirely sure what you after.

Can you post the code you currently have? If you don't have any can you explain exactly should be happening.

Thanks,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
  #3 (permalink)  
Old Nov 3rd, 2007, 18:13
New Member
Join Date: Nov 2007
Location: USA
Age: 35
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <SPAN> help

Quote:
Originally Posted by Rakuli View Post
Okay, so I can see a few problems here.

First and foremost, you cannot have two elements on the same page with the same ID, this is completely against the DOM -- ID should be unique.

I can think of a few things to help you but I'm not entirely sure what you after.

Can you post the code you currently have? If you don't have any can you explain exactly should be happening.

Thanks,
Thanks for reply,

Yes, i do not have anything at this point , becausei have no clue where should i start from.

So from the beginning, I’m imitating the .Net GridView control using repeater control. The database call returns me the list of words and their synonyms.(like in my original post).
The word and it’s synonym has the same ID(in database). Instead of using hyperlink I use <SPAN> with some adjustments to make it look like a hyperlink.
So now, you click on the link, I need to make it disabled so user can not click on it again and add this value into another <SPAN> named spContainer. Once it inside spContainer you should be able to click on it too to remove it, and enable(make it clickable) it back in the list. I also need to check for the synonym of the clicked word and if there is one make it disabled as well.
So this is pretty much it.

Thank you for your help Rakuli
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can <span></span> tags have position relative? Oak Web Page Design 13 Mar 9th, 2008 17:04
how do i extend the background on a span aflacduck Starting Out 4 May 27th, 2007 19:51
Div and Span tags... jjgamepro17 Web Page Design 4 Nov 7th, 2006 19:22
Span questions maxelcat Web Page Design 2 Aug 7th, 2006 11:07
Wrapping by span hessodreamy Web Page Design 3 Sep 14th, 2005 07:34


All times are GMT. The time now is 19:23.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43