Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Radio Buttons in JSP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Radio Buttons in JSP

    I think your IF statement should look like this: if (SCR01.getFieldValueWithTransform("TESTFLD", QUOTED_TRANSFORM) == 'Y')

  • #2
    Radio Buttons in JSP

    Mark, Thanks for the reply. My statement now looks like this -
     input type=radio name=radio <% if (SCR01.getFieldValueWithTransform("TESTFLD", QUOTED_TRANSFORM) == 'Y') { %> checked <% } %> 
    When I save, I get an error that says "JavaCompile: Incompatible operand types String and char." I have tried everything I can think of......any ideas? Thanks, Joe

    Comment


    • #3
      Radio Buttons in JSP

      a String in Java is surrounded by double quotes, as in "Y", single quotes ('Y') equals a char.

      Comment


      • #4
        Radio Buttons in JSP

        Gerry, Thanks for the reply - that solved my compile issue. Unfortunately, I am still having problems......but I am trying to solve before asking for more assistance! Thanks again, Joe Wells

        Comment


        • #5
          Radio Buttons in JSP

          Does anyone know where I can get documentation for getFieldValueWithTransform ? Thanks, Joe

          Comment


          • #6
            Radio Buttons in JSP

            For strings you should use the equals method instead of ==. Using == will give you unpredictable results. if (SCR01.getFieldValueWithTransform("TESTFLD", QUOTED_TRANSFORM).equals("Y"))

            Comment


            • #7
              Radio Buttons in JSP

              I have a simple webfaced program and want to add radio buttons to enter values for a "Y"/"N" field. When the page runs, the radio buttons are (by default) not checked. Enter is automatically entered once the radio button is checked (which is what I want). However, the radio buttons then revert to their defaul value of not checked. I am thinking that it should be really easy to insert a java IF statement something like this - ......radio name=radio <% if (SCR01.getFieldValueWithTransform("TESTFLD", QUOTED_TRANSFORM) = 'Y' { %> checked <% } %> onclick=TESTFLD.value="Y";validateAndSubmit('Enter')>Yes To retain the last status......the problem is that I am somewhat ignorant when it comes to java and cannot make the ^*^@$#! compile. I am sure that it is something really simple! Any help would be greatly appreciated! Thanks, Joe

              Comment


              • #8
                Radio Buttons in JSP

                BINGO! Now for the $64,000 question........where on earth is this documented?!?!?! Thanks for your help! Joe

                Comment

                Working...
                X