aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Input type attribute 'name' query? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Input type attribute Watch "Input type attribute New topic
Author

Input type attribute 'name' query?

Jignesh Gohel
Ranch Hand

Joined: Dec 28, 2004
Posts: 276
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 ]

Regards,
Jignesh

The Art Of Life Is To Know When To Be Useless And When To Be Useful - CHUANG TZU
Kj Reddy
Ranch Hand

Joined: Sep 20, 2003
Posts: 1704
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

Joined: Dec 28, 2004
Posts: 276
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
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You need to do Paging with server side code and not JavaScript.

Eric
Jignesh Gohel
Ranch Hand

Joined: Dec 28, 2004
Posts: 276
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

Joined: Sep 20, 2003
Posts: 1704
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

Joined: Dec 28, 2004
Posts: 276
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

Joined: Sep 20, 2003
Posts: 1704
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Input type attribute 'name' query?
 
Similar Threads
text field data validation
File upload filter
accessing Array of radiobutton array
Struts2 Data Transfer
value geting of form element