• 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

Input type attribute 'name' query?

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

can i make the name of a input type element dynamic ,ie i want to take a hidden field in my jsp page whose name i have to give in a for loop like

hCount1,hCount2,hCount3......etc. ,that is the name is hCount but i want to attach a counter with this name.

So how can i achieve that??

Thanks,
Jignesh
[ March 16, 2006: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jignesh Gohel:
Hi,

can i make the name of a input type element dynamic ,ie i want to take a hidden field in my jsp page whose name i have to give in a for loop like

hCount1,hCount2,hCount3......etc. ,that is the name is hCount but i want to attach a counter with this name.

So how can i achieve that??

Thanks,
Jignesh



Yes you can do that. If you are generating the fields in JSP the code looks like this:



I just wrote simple code to display how we can write. There other approaches too, you can use tag libraries also.
 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot,

I have one more query which i forgot to write that is i have some search results which are at present sufficient to get displayed on one page but in the future i may have results which may not fit in one page.That is i wnat to display a limited number of results per page.I want to do it using javascript.

So help me regarding this & if possible can i have a sample code or its address so that i can view that??

Thanks ,
Jignesh
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to do Paging with server side code and not JavaScript.

Eric
 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Eric,

But i didnt get that thing Paging on the server side what do you mean by that??

Can u provide me a link for a smaple example.

I have one more doubt thats:

In my JSP page i want a HYPERLINK.When i click on the hyperlink i should get some unique value associated with that hyperlink & that unique value i want to provide using JSP using a for loop or something which provides unique value to each hyperlink.So that when i click on a particular hyperlink the unique value provided by me to the hyperlink gets displayed in the browser using javascript fucntion in whcih there is a documnet.write() to display that unique value.I tried a lot to do this thing but its not done ..

So kindly suggest what i should do to achieve this thing.

Thanks,
Jignesh
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jignesh Gohel:
Thanks Eric,

But i didnt get that thing Paging on the server side what do you mean by that??



You need to handle Paging on the server side(means in your JSP code) and not client side(JavaScript). You can search in www.google.com and can find lot of examples.
 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,
Mr.Reddy

Also help me to solve my other doubt that is:

In my JSP page i want a HYPERLINK.When i click on the hyperlink i should get some unique value associated with that hyperlink & that unique value i want to provide using JSP using a for loop or something which provides unique value to each hyperlink.So that when i click on a particular hyperlink the unique value provided by me to the hyperlink gets displayed in the browser using javascript fucntion in whcih there is a documnet.write() to display that unique value.I tried a lot to do this thing but its not done .. So how can i achieve that???



Jignesh
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jignesh Gohel:
Thanks,
Mr.Reddy

Also help me to solve my other doubt that is:
Jignesh


Jignesh I am not sure I understood your problem correctly. So, I did not answered your query. You can create a hyper link in HTML and on click of it you can call a JavaScript function. Do you dynamically generate the unique value dynamically or how you do it?

If you post your code logic may be some one can help you if not me.

Try to start a seperate thread for every query with appropriate subject, so you may get more response. Normally people do skip reading threads by reading the subject.
[ March 16, 2006: Message edited by: KJ Reddy ]
 
Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic