need some help to write a javascript function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • adi

    need some help to write a javascript function

    Hello guys.

    This is Aditya. I have a jsp where i am displaying more than 10,000
    records and finally i am adding the values of these records in the end
    and displaying the total value as Total: .
    My Task:
    Now i want to write a javafunction which can shrink these 10,000
    records into a word say (Add). When the user comes and selects or
    clicks this Add then he can view all the 10,000 records and if he
    doesnot click Add, then only the total should be displayed.

    I have already wriiten the logic to display the total only. Now i am
    struck with the javascript part .

    It would be really great if anybody help me out with this problem.
    Waiting for your replies.

    Thanks in Advance.
    Aditya Reddy
  • Thomas 'PointedEars' Lahn

    #2
    Re: need some help to write a javascript function

    adi wrote:
    [...] I have a jsp where i am displaying more than 10,000
    records and finally i am adding the values of these records in the
    end and displaying the total value as Total: .
    My Task:
    Now i want to write a javafunction which can shrink these 10,000
    records into a word say (Add). When the user comes and selects or
    clicks this Add then he can view all the 10,000 records and if he
    doesnot click Add, then only the total should be displayed.
    >
    I have already wriiten the logic to display the total only. Now i am
    struck with the javascript part .
    JSP are JavaServer Pages, not JavaScript Pages. Java, unless related to
    LiveConnect/XPConnect, is off-topic here and on-topic in comp.lang.java. ALL
    instead.

    You really don't need J(ava)Script here. What exactly do you want to
    accomplish with it? Which part of J(ava)Script programming have you
    problems with?

    Please read <http://www.jibbering.c om/faq/#FAQ2_3>.


    PointedEars
    --
    var bugRiddenCrashP ronePieceOfJunk = (
    navigator.userA gent.indexOf('M SIE 5') != -1
    && navigator.userA gent.indexOf('M ac') != -1
    ) // Plone, register_functi on.js:16

    Comment

    • yukabuk

      #3
      Re: need some help to write a javascript function

      I think what shes trying to explain is have a hidden div containing
      results which then displays after the user clicks on the 'Add' link.

      Aditya, try this...

      <div id='results' style='display: none;'>
      ....
      All your html results in a table
      ....
      </div>

      <button
      onmouseup='docu ment.getElement ById("results") .style.display= "inline";'> Add</
      button>

      Graham

      Comment

      Working...