• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

compare columns

 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using JSP I am displaying one table with 10 columns. I need to compare value in one column(say A,Static in nature) with value in another column (say B,which end user is going to enter through textfield)& want to show a message through alert if B<A. How i could achieve the same?

Shriniwas
[ October 06, 2006: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shrinivas,
This can be done by javascript. Keep all the static values in a javascript array. If you are going to compare with 2 columns in a same row, once the user inputs a value write a onBlur action for that field. In the onBlur function do the necessary comaprison of the user's input with that of the javascript array and show a java script alert after validation.
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks first of all
I have not used javascript much can you suggest any site/refernce to do the same?
Shriniwas
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Shrinivas Mujumdar,

"Help!!!" is a poor chocie for a topic subject. I've adjusted this one for you. Please read this for more information.
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what you can do is give your table an ID.



Now in javascript you access the table by the following mechanism.



This will return the table object.
Now using this table object you can move around in the table as follows



I hope the above will give you a start in the coding area. you can use the
w3schools website for further information and as usual google is always there to help.
Please come back in case you need clarification.
 
reply
    Bookmark Topic Watch Topic
  • New Topic