'next' button gives error

Posted on 2005-04-28
Last Modified: 2008-03-10

i do

<form method='post' action='searchsectionb.asp' name='input_form'>
<input type='hidden' name='form_ID' value='195'>
<input type='hidden' name='lRACID' value='59296'>
<input type='hidden' name='irn' value=''>
<input type='hidden' name='approvedpersonname' value=''>
<input type='hidden' name='dob' value=''>
<input type='hidden' name='orderby' value='1'>
<input type='hidden' name='pagenum' value='1'>

<tr><td align='left' width='30%'>

<table width='100%' border='0' cellspacing='0' cellpadding='0' class='bodytext'>
<td width='50%'>&nbsp;</td>
<td width='50%'><a href="#" onClick="document.input_form.pagenum.value='2';document.input_form.submit();return false;">Next >></a> </td>


and get

document.input_form.pagenum is null or not an object

any ideas?
Question by:amoran
    LVL 6

    Expert Comment

    Hi amoran,

    try without document, like this - onclick="input_form.pagenum.value = '2';...
    You get this error in IE, right?

    LVL 25

    Expert Comment

    It does not give error for me...

    unless pagenum field is there it will not give u that kind of an error

    try this:
    <a href="#" onClick="if(document.input_form.pagenum)document.input_form.pagenum.value='2';document.input_form.submit();return false;">
    LVL 12

    Expert Comment

    I guess you are using a buggy IE,
     try updating your IE
    try it from another machine or browser.

    I am not getting any error message.

    LVL 15

    Accepted Solution

    whene referencing objects on the page via in the format
    they should have an id property.

    you form and inputs have their names set without their id's

    so either
    1) add  the id <form method='post' action='searchsectionb.asp' name='input_form' id='input_form'>
        and <input type='hidden' name='pagenum' id='pagenum' value='1'>

    2) use the forms collection syntax:
    ><a href="#" onClick="document.forms['input_form'].elements['pagenum'].value='2';document.input_form.submit();return false;">  


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
    Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now