•
•
•
•
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,795 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,123 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: 1639 | Replies: 2 | Solved
![]() |
•
•
Join Date: Oct 2007
Posts: 63
Reputation:
Rep Power: 0
Solved Threads: 0
Hey guys,
I am trying to make a drop down menu that gives options such as (right, left, center) so that I can choose one of those and align the text in one of my layers. I am having trouble figuring out how to make this work so if someone can help me that would be great.
Basically I need a drop down menu with those three options, and when one of the options is chosen, I need it to call a javascript function onchange (i don't want to use a button, i just want to align the text instantly) and then I need the javascript function to use getElementById('mylayer') to change the alignment of the text in that layer. Can anyone help me? I'm sure it is simple and involves the values of my drop down menu, but I cannot manage to figure it out. Thanks!
I am trying to make a drop down menu that gives options such as (right, left, center) so that I can choose one of those and align the text in one of my layers. I am having trouble figuring out how to make this work so if someone can help me that would be great.
Basically I need a drop down menu with those three options, and when one of the options is chosen, I need it to call a javascript function onchange (i don't want to use a button, i just want to align the text instantly) and then I need the javascript function to use getElementById('mylayer') to change the alignment of the text in that layer. Can anyone help me? I'm sure it is simple and involves the values of my drop down menu, but I cannot manage to figure it out. Thanks!
•
•
Join Date: May 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 1
•
•
•
•
Hey guys,
I am trying to make a drop down menu that gives options such as (right, left, center) so that I can choose one of those and align the text in one of my layers. I am having trouble figuring out how to make this work so if someone can help me that would be great.
Basically I need a drop down menu with those three options, and when one of the options is chosen, I need it to call a javascript function onchange (i don't want to use a button, i just want to align the text instantly) and then I need the javascript function to use getElementById('mylayer') to change the alignment of the text in that layer. Can anyone help me? I'm sure it is simple and involves the values of my drop down menu, but I cannot manage to figure it out. Thanks!
try this.........
html Syntax (Toggle Plain Text)
<html> <head> <script type="text/javascript"> function alignl(ele){ document.getElementById('lay').style.align=ele; } </script> </head> <body> <layer id='lay'></layer> <select id='s' name='s' onchange="alignl(this.value);"> <option value="left">left</option> <option value="right">right</option> <option value="center">center</option> <option value="top">top</option> </select> </body> </html>
Last edited by peter_budo : May 31st, 2008 at 6:27 am. Reason: Keep It Organized - please use [code] tags
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Tooltips for drop down boxes (JavaScript / DHTML / AJAX)
- Create a cross-browser compatible, single-level, drop-down menu (Web Design Tutorials)
- dinamic drop down menu (PHP)
- HELP with CSS/Javascript Drop down menu from Dynamic Drive (HTML and CSS)
- php drop down menu to search multiple sql tables (PHP)
- AJAX : Am i right with the concept? (JavaScript / DHTML / AJAX)
- Hijackthis report, I just don't know (Viruses, Spyware and other Nasties)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: problem with the body and style.....
- Next Thread: multiple radiobutton values ajax problem


Linear Mode