473,407 Members | 2,312 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,407 software developers and data experts.

simple radiogroup chambawamba


hi

i want to access the current value of this radiogroup in my
javascript function. unfortunately the id's are changing
on every request (some hash thing of pear.php.net::html_quickform-package).
Expand|Select|Wrap|Line Numbers
  1. ....
  2. <input onclick="foo();" value="0" type="radio" id="qf_18d951"
  3. name="ident" checked="checked" /><label for="qf_18d951">none</label>
  4. <input onclick="foo();" value="1" type="radio" id="qf_fd9452"
  5. name="ident" /><label for="qf_fd9452">1</label>
  6.  
  7.  
  8. <input onclick="foo();" value="2" type="radio" id="qf_a9078a"
  9. name="ident" /><label for="qf_a9078a">2</label>
  10.  
  11. ....
  12.  

here is what did _not_ work out, because i somehow dont
get a valid object in IE6 nor in a later Gecko. i am sure
i mixed something silly up, but i just cannot spot it.
Expand|Select|Wrap|Line Numbers
  1. function foo()
  2. {
  3. myobj = document.getElementByName('ident').value;
  4. myobj2 = document.getElementsByName('ident')[0].value;
  5. }
  6.  

anyone? tnx in adv!

//m


__
note: emails to reply-address end up in nirvana (spam, you know).
Jul 23 '05 #1
1 1029
Matthias H. Risse wrote:

i want to access the current value of this radiogroup in my
javascript function.
Expand|Select|Wrap|Line Numbers
  1.  ...
  2.  <input onclick="foo();" value="0" type="radio" id="qf_18d951"
  3.  name="ident" checked="checked" /><label for="qf_18d951">none</label>
  4.  <input onclick="foo();" value="1" type="radio" id="qf_fd9452"
  5.  name="ident" /><label for="qf_fd9452">1</label>
  6.  <input onclick="foo();" value="2" type="radio" id="qf_a9078a"
  7.  name="ident" /><label for="qf_a9078a">2</label>
  8.  ...
  9.  


here is what did _not_ work out, because i somehow dont
get a valid object in IE6 nor in a later Gecko. i am sure
i mixed something silly up, but i just cannot spot it.
Expand|Select|Wrap|Line Numbers
  1.  function foo()
  2.  {
  3.      myobj = document.getElementByName('ident').value;
  4.      myobj2 = document.getElementsByName('ident')[0].value;
  5.  }
  6.  


function foo(){
d=document.forms[0].elements['ident'];
for(i=0;i<d.length;i++){
if(d[i].checked){
return d[i].value
}
}
return "Not selected"
}
Mick
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: delisonews | last post by:
I'm looking for a simple, filesystem-based message board. (No MySQL!) Something that I could include easily in my code: include '../inc/messageboard.php'; .... so that the board shows up at...
3
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
7
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
14
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.