Solved

Forms and Javascript

Posted on 2006-11-07
6
683 Views
Last Modified: 2012-05-05

Hi Experts,

I have an options form on a JSP that consist of multiple radio buttons, i'm trying to use javascript and i'm having trouble finding the property because the form uses transfer beans if name a property

<html:radio proptery="mytransferbean.getFormAttrubite" value="true" onClick=callJavaScript/>

 as opposed to putting all the form attributes in the form directly

<html:radio proptery="getFromAttrubite" value="true" onClick=callJavaScript/>

My javascript doesnt like nested names so

document.myForm.mytransferbean.getFormAttrubute

isnt found

Any ideas on  how to solve this problem????  I've tried using

document.myForm.element[1] etc but because the form is quite large its to many elements to manage.

Thanks!
Fynzy
0
Comment
Question by:fyness
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 500 total points
ID: 17891014
gerElementByName("mytransferbean.getFormAttrubite");
0
 
LVL 9

Expert Comment

by:owenli27
ID: 17891029
You could directly pass radio object to Javascript function .
<html:radio proptery="mytransferbean.getFormAttrubite" value="true"  onClick="callJavaScript( this )"/>

function callJavaScript (obj) {
    alert(obj.value);
}
0
 

Author Comment

by:fyness
ID: 17891183

if i use getElementByName("")  if i have 2 properties the same, both radio buttons can i call each one as normal

document.getForm.getAttrubiteRadio[0]
document.getForm.getAttrubiteRadio[1]

Thanks,
Suzy
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 17891639
yes you should be able to do that... if there are more objects of the same name, the fuction returns an array of objects.
0
 

Author Comment

by:fyness
ID: 17897392

when i use getElementByName i get the following javascript error in firefox

document.myForm.getElementByName is not a function
0
 

Author Comment

by:fyness
ID: 17897804

Got it working!

works with

document.getElementsByName("")

Thanks!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Part One of the two-part Q&A series with MalwareTech.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question