Results 1 to 3 of 3
  1. #1
    swapnanair is offline Member
    Join Date
    Nov 2007
    Posts
    3
    Rep Power
    0

    Default property for radio buttons

    I am using struts, while designing a jsp page i am getting an error.
    For radio buttons i wrote

    <html:radio property="xxx" value="yes">yes</html:radio>
    <html:radio property="xxx" value="no">no</html:radio>

    but when i try to get this value

    alert(document.forms[0].elements['xxx'].value);

    i am getting as undefined.can any one help me regarding this one as how to define radio buttons with same property in struts

  2. #2
    achillesheel is offline Member
    Join Date
    Dec 2007
    Posts
    1
    Rep Power
    0

    Default

    id attribute value should be used in javascript...

    <html:radio property="xxx" value="yes" id="idname">yes</html:radio>

    alert(document.forms[0].elements['idname'].value);

    try this..

  3. #3
    swapnanair is offline Member
    Join Date
    Nov 2007
    Posts
    3
    Rep Power
    0

    Default

    First of all thanks for ur reply,i have already tried with id but still i am unable to get the value.

    error:org.apache.jasper.JasperException: /jsp/login/ProjectStudyCrop.jsp(56,8) Attribute id invalid for tag radio according to TLD

Similar Threads

  1. Disable Radio button
    By AJG in forum New To Java
    Replies: 3
    Last Post: 05-10-2011, 11:09 AM
  2. Non functional radio buttons and messed up array
    By flameofSuzaku in forum New To Java
    Replies: 2
    Last Post: 01-10-2011, 05:38 PM
  3. Setting the label of radio buttons from Resource bundle
    By rajeeshankar in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 12-17-2007, 09:23 AM
  4. Radio button values are not lose
    By chockalingam in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 12-03-2007, 08:14 AM
  5. Next, Finish Buttons !!!
    By pele in forum SWT / JFace
    Replies: 1
    Last Post: 07-14-2007, 05:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •