Trying to pass JSP variable into Input:select attribute, help needed!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • danwms
    New Member
    • Apr 2007
    • 3

    #1

    Trying to pass JSP variable into Input:select attribute, help needed!

    Hi, im new to this forum but if have tried everything else and this is driving me a bit crazy. I am desperate for some help and I know this is going to be a realy simple thing its just my mind has gone dead with it.

    I have the following :

    Code:
       <input:select
         bean="counterGroup"
         name='airlineLogoFlt1'
         attributes="<%= visibleDefaultAttr %>"
         attributesText='id="airlineLogoFlt1"'
         options="<%= airlineLogos %>"
         default="<%= airlineLogoFlt[F] %>"
       />
    Where it says name='airlineLo goFlt1', I want to replace the 1 in Flt1 with the value you of either a JSP variable F or a JavaScript variable f I don’t mind which one I have to use but basically I want to change the value of F/f to be able to change the number associated with the Flt.

    When I try doing :
    Code:
    name='airlineLogoFlt<%= F %>'
    I get name="airlineLo goFlt&lt;%= F %&gt;"


    I also want to do the same thing where it says attributesText= 'id="airlineLog oFlt1"' and I am also having trouble here as well.

    Any help would be much appreciated.

    Thanks in advance.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by danwms
    Hi, im new to this forum but if have tried everything else and this is driving me a bit crazy. I am desperate for some help and I know this is going to be a realy simple thing its just my mind has gone dead with it.

    I have the following :

    Code:
    <input:select
    bean="counterGroup"
    name='airlineLogoFlt1'
    attributes="<%= visibleDefaultAttr %>"
    attributesText='id="airlineLogoFlt1"'
    options="<%= airlineLogos %>"
    default="<%= airlineLogoFlt[F] %>"
    />
    Where it says name='airlineLo goFlt1', I want to replace the 1 in Flt1 with the value you of either a JSP variable F or a JavaScript variable f I don’t mind which one I have to use but basically I want to change the value of F/f to be able to change the number associated with the Flt.

    When I try doing :
    Code:
    name='airlineLogoFlt<%= F %>'
    I get name="airlineLo goFlt&lt;%= F %&gt;"


    I also want to do the same thing where it says attributesText= 'id="airlineLog oFlt1"' and I am also having trouble here as well.

    Any help would be much appreciated.

    Thanks in advance.
    did you try
    Code:
    name='airlineLogoFlt<%=value %>'

    Comment

    • danwms
      New Member
      • Apr 2007
      • 3

      #3
      Originally posted by r035198x
      did you try
      Code:
      name='airlineLogoFlt<%=value %>'
      The F is the value I want to pass in, I think I am having trouble with the " ' characters.
      For some reason it is not switching to the JSP code and is simply printing out the characters as i have typed them.

      When I view the source of the page after it has been run i get:


      name="airlineLo goFlt&lt;%=F %&gt;"

      Thank you for your quick reply by the way.

      Comment

      • danwms
        New Member
        • Apr 2007
        • 3

        #4
        I managed to sort this out by doing,

        String q = "\"";

        and then substituting the " with q.

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by danwms
          I managed to sort this out by doing,

          String q = "\"";

          and then substituting the " with q.
          Good work!

          Good luck with the rest of it.

          Comment

          Working...