• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can i modify my code in this way ?

 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have sample code as follow, it should have more methods like this with the different of form.isPpo_chkbox_?() and form.getPpo_txtfieldscno_?(), ? - is number like 2,3,4,5...






as the methods are doing the same function, someone suggest that i do like this case



but i think we have problem of calling form.getPpo_txtfieldscno(i) with parameter i , can someone suggest how to solve it ? thank you

(Marilyn added line breaks)
[ June 15, 2005: Message edited by: Marilyn de Queiroz ]
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Notice how much easier it is to read formatted code than code on one line that is over 400 characters long?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but i think we have problem of calling form.getPpo_txtfieldscno(i) with parameter i , can someone suggest how to solve it ?


If you wrote getPpo_txtfieldsscno(i) you can solve the problem there. How do you get one text field from a bunch of text fields by knowing a number? You need some kind of indexed bunch. If you know the number of text fields ahead of time an array is fine. If you don't, one of the Collections would do the job.

See if you can build some code around that idea. If you get stuck, post what you have and we'll take a look.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic