'next' button gives error

hi

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'>
<tr>
<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>
</tr>
</table>

</td></form>

and get

document.input_form.pagenum is null or not an object

any ideas?
thanks
AM
amoranAsked:
Who is Participating?
 
SnowFlakeConnect With a Mentor Commented:
whene referencing objects on the page via in the format
document.input_form
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'>

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

SnowFlake
0
 
German_RummCommented:
Hi amoran,

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

Cheers!
0
 
archrajanCommented:
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;">
0
 
str_kaniCommented:
I guess you are using a buggy IE,
 try updating your IE
or
try it from another machine or browser.

I am not getting any error message.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.