JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 24th, 2004, 03:49 PM
_JSLearner_ _JSLearner_ is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 _JSLearner_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Red face calling getElementById

HI!

I have a listbox with some values
I wanna update those values witin this td cell

I can get the value in a textbox
but i want the value to be presented in the cell data <td>
instead of the textbox

check out my listing...
BTW one of the functions is from this forum,
but I can't get it to really work.
Code:
<html>
<head>
<script language="javascript">
function disp()
{
option=document.forms[0].selPatchtyp.options[document.forms[0].selPatchtyp.selectedIndex].text
txt=option 
// document.forms[0].favorite.value=txt
// document.forms[0].gurka.value=txt
alert(txt)
change(gubbel,txt)
}
function change(div_id,val){
elm=document.getElementById(div_id); 
elm.innerHTML=val;
}
</script>
</head>
<body>
<form name="hert">
<table>
<tr>
<td><div id="gubbel"><p value=txt></p></div></td>
</tr>
</table>
<select name="selPatchtyp" onchange="disp()">
<option>Hej
<option>Pa
<option>Dig
<!-- <option selected name="1" value="odd">odd</option>
<option name="2" value="odd_pt">Udda Pigtail single</option>
<option name="3" value="odd_rb">Udda Pigtail ribbon</option>
--> </select>
</form>
</body>
</html>

Last edited by stumpy : April 27th, 2004 at 06:36 AM. Reason: Code placed in [code] tags

Reply With Quote
  #2  
Old April 27th, 2004, 06:35 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Where you call the "change" function, you should have gubbel in quotes, as it is a variable.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Listbox problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway