Solved

Forms and Javascript

Posted on 2006-11-07
6
682 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
immutable object concept 5 143
Using Tomcat as raspberry pi java app server 13 287
listing all functions in JavaScript 19 253
collection output issue 9 92
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 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