Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
64
rated 0 times [  66] [ 2]  / answers: 1 / hits: 90070  / 11 Years ago, tue, october 8, 2013, 12:00:00

I have asp.net application with one panel.
Inside that panel i have one image button and textbox.
I have written a javascript validation function for textbox which will display alert box for entering some values in textbox.
Now this function is not working gave run-time error:




Object required




My code is here:



<asp:Panel ID=pnlTop runat=server>
<tr height=35px valign=top>
<td align=right valign=middle colspan=2 height=50>
<asp:ImageButton ID=imgbtnGOTO runat=server ToolTip=View Specific Record BorderWidth=0
ImageAlign=AbsMiddle OnClientClick=javascript:return fnCheck()></asp:ImageButton>&nbsp;&nbsp;
<asp:TextBox ID=txtPagingGoto CssClass=clsTableCellLeft Width=215px runat=server CausesValidation=true></asp:TextBox>
</td>
</tr>
</asp:Panel>


My Javascript function is:



function fnCheck() {
if ((document.getElementById(txtPagingGoto).value).length == 0) {
alert(The textbox should not be empty);
}
}


Please suggest solution for this.


More From » asp.net

 Answers
45
function fncheck()
{
var pgng = document.getElementById(<%=txtPagingGoto.ClientID%>).value.trim();
if(pgnd == )
{
alert('The textbox should not be empty...');
document.getElementById(<%=txtfname.ClientID%>).focus();
return false;
}
}

[#75150] Monday, October 7, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kevonmoisesf

Total Points: 693
Total Questions: 101
Total Answers: 128

Location: Reunion
Member since Mon, Dec 28, 2020
4 Years ago
kevonmoisesf questions
Sat, Jan 23, 21, 00:00, 3 Years ago
Tue, Feb 18, 20, 00:00, 4 Years ago
Wed, Jun 12, 19, 00:00, 5 Years ago
;