how to set document stable in a same place

  • Thread starter balakrishnan.dinesh
  • Start date
B

balakrishnan.dinesh

hi Frnds,

My senario is this,
~ Im having a html page which have a content of more than one
page, so obivously scroll will be present in my page.
~ In the bottom of my page , Im having some 10 checkbox for some
option.
to select all checkboxes, im having link called selectAll ,

~ The problem is -
When i click the selectAll link, all checkboxes were checked,
but the page going to the top , eventhough the focus is still in the
selectAll link .

~ I dont why the page is going top, can u tell me the reason, And
tell me to be stay there in the same position after clicking the link.

Thank u

Rgrds...
Dinesh
 
R

RobG

hi Frnds,

My senario is this,
~ Im having a html page which have a content of more than one
page, so obivously scroll will be present in my page.
~ In the bottom of my page , Im having some 10 checkbox for some
option.
to select all checkboxes, im having link called selectAll ,

~ The problem is -
When i click the selectAll link, all checkboxes were checked,
but the page going to the top , eventhough the focus is still in the
selectAll link .

~ I dont why the page is going top, can u tell me the reason, And
tell me to be stay there in the same position after clicking the link.

Have the href attribute of the link do something useful (like request a
page from the server with the checkboxes checked). Have the onclick
handler return the exit status of the function it calls. Have the
function return false if the script runs successfully, e.g.:

<a href="allChecked.html" onclick="return checkAll();">Check all</a>

<script type="text/javascript">

function checkAll()
{
/* code to check all checkboxes */

if ( /* everything is OK */ ) return false;

}
</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,248
Latest member
MagdalenaB

Latest Threads

Top