Input type attribute name query??
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.
Also 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.So i want to provide the next page ,previous page technique using javascript that is some page counter.
So how can i achieve these things??
Thanks,
Jignesh
[623 byte] By [
j.gohel] at [2007-11-11 8:14:45]

# 1 Re: Input type attribute name query??
I dont know any jsp but i do php, and i should think the method for dynamically assigning a name for the input attribute should be the same in jsp.
for ($i = 1; $i<= counter; $i++)
{
print '<input type="hidden" name="' . Count . $i . '">';
}
The above code is an example in php how you can dynamically give an input attribute a name.
As for your second question, is you data stored in a database such as mysql? Is so u need to use the LIMIT keyword in SQL, which limits u to a certain number of records, so u can limit to ten records per page. then u need to set page numbers, every time u click a previous or next button it should incrememt the page number or decrememnt the page number, u need to send the page number in the URL like this
www.mysite.com/mycontacts.php?page=2
then u use the page number with a bit of maths to get the next set of records from the database. hope that helps.
major at 2007-11-11 23:34:54 >
