473,395 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Help with Javascript on generated html with no ids

Hi,

We have an application that generates html code through a GUI... The html fields (like radio, checkbox etc..) generated are all inside table/tr/td. And none of the fields are assigned any id.

The issue currently is that we have many radio buttons generated in the same way. They just cannot be grouped. And we need to make sure that the user can select only one at a given time... We think we can use javascript for this.. but since none of the fields have an id we are in a tight spot - Can someone suggest if it is possible to call javascript when there are no field id's or even names? (We tried using getElementById and getElementByName - neither give any results - they evaluate to null...

Thanks,
A
Jan 4 '07 #1
4 2199
drhowarddrfine
7,435 Expert 4TB
You need to learn the DOM better as it is the only way to do this. I'm too rusty myself to help further than that.
Jan 4 '07 #2
DeMan
1,806 1GB
why can't they be grouped together?
Jan 4 '07 #3
drhowarddrfine
7,435 Expert 4TB
There should also be a getelementbytag function.
Jan 4 '07 #4
ronverdonk
4,258 Expert 4TB
If your boxes have a name, as they should, you can address them using one of the following formats:
[html]
//where myform and radioname are names of your form/element.
document.myform.radioname
//where i is the position of the radio button within form
document.myform.elements[i]
//where i is the position of the radio within a group of radio buttons.
document.myform.radioname[i] [/html]
See DOM info at Radio button DOM info

Ronald
Jan 4 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Web Spinner | last post by:
I am running Windows 2000 and I can't seem to get my JavaScript working with ASP. I placed my HTML code in a file called x.asp under c:\Inetpub\wwwroot, and I placed my JavaScript code in a file...
14
by: Akbar | last post by:
Hey there, Big-time curiosity issue here... Here's the test code (it's not that long)... it's to display a large number of image links with captions, ideally pulled in from an external file...
6
by: Andy | last post by:
I'm not sure why my checkbox code is not working as per intended. It always keeps saying "Please select the department" even though I check the department... appreciate any help. <!DOCTYPE HTML...
11
by: milkyway | last post by:
Hello, I have an HTML page that I am trying to import 2 .js file (I created) into. These files are: row_functions.js and data_check_functions.js. Whenever I bring the contents of the files into...
14
by: Rich | last post by:
I am converting my enterprise solution from VS 2003 (.NET v1.1.4322) to VS 2005 (.NET v2.0.50727). The entire solution uses serveral technologies - Windows Server 2003 (AD, SQL Server 2000, IIS,...
3
by: Nathan Gilbert | last post by:
I am wanting to use javascript to select between different *.css files dependent on the user's browser. I am also wanting to generate the html document containing this javascript dynamically using...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
2
by: davidson1 | last post by:
Hai friends..for menu to use in my website..i found in one website....pl look below website.... http://www.dynamicdrive.com/dynamicindex1/omnislide/index.htm i downloaded 2 files.... ...
0
by: richard12345 | last post by:
Hi Guys I have problem with site I am building. The sidebar with menu and other thinks is overlapping footer. The footer move with the content and but it dos it dos not move with the sidebar. ...
2
by: embz | last post by:
this post concerns three pages. 1. this page: http://www.katherine-designs.com/sendemail.php i get the following errors: a lot of it seems to deal with the PHP code i inserted to the page....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.