.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem with java script basic script constraint.

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :ASP.Net
 hi my code isfunction checkValue(){ if(''==document.getElementById ('textbox1').value) { alert('Please enter a value'); } }   and i am calling it on a button click event but its not responding. html code:  <asp:Button ID="btnButton" runat="server" Text="Button" onclick="checkValue()"/>   please help.

View Complete Post

More Related Resource Links

java script problem !

hi.i have this code : <asp:TextBox ID="TextBox1" runat="server" Width="92px"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="ok" Width="64px" /> <asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1"></asp:ListItem> <asp:ListItem Value="2"></asp:ListItem> <asp:ListItem Value="3"></asp:ListItem> </asp:CheckBoxList> and in button i have this code : If TextBox1.Text.Contains("1").ToString Then CheckBoxList1.Items.Item(0).Selected = True Else CheckBoxList1.Items.Item(0).Selected = False End If If TextBox1.Text.Contains("2").ToString Then CheckBoxList1.Items.Item(1).Selected = True Else CheckBoxList1.Items.Item(1).Selected = False End If If TextBox1.Text.Contains("3").ToString Then CheckBoxList1.Items.Item(2).Selected = True Else CheckBoxList1.Items.Item(2).Selected = False End If how i can do this code with javascript instead of vb code ?

Problem with IndexOf function in Java script?


Hi all,  i have one problem while using Index Of function in java script. I am using this in this way:

var ss=(document.getElementById('<%=HiddenField1.ClientID%>').value.indexOf(","+document.getElementById('<%=yyy.ClientID%>').value+"-"+document.getElementById(str).value,20));                       

The Problem in document.write() in java script


Hi Experts

I wrote a simple Java Script code that is created an iframe tag. I want to write it on form.

<script >

                Var iframe = '<iframe src="p12.aspx"></iframe>';



But when document.write(iframe) is run, the view source code of my page is damage and I see only iframe in my page. I think the other controls of the page is removed!

How can I fix this problem?

With regards.Mojtaba

Problem with calling asp button click event from Java script


Dear all ,


I m using these following lines of codes in my java script funtion Save()




var btnSave = document.getElementById('<%=btnSave.ClientID%>');


In ascx,

<asp:Button runat="server" style="display:

write a java script to show a msg wan to colse yes or no

 write a java script to show a msg wan to colse yes or no.if user select yes then another function is call then he select no then nothing happend

ssrs 2008 R2 - report parameter with no default set throws java script error

We have recently upgraded from SQL Server 2008 to SQL Server 2008 R2....I am experiencing a problem with my report parameters on my SSRS reports. It seems that my report parameters that I do not have a specified 'default' value throws a java script error when I try and run/render the report under R2.  As soon as I put a 'default' value on the report param, everything is fine.  However, that is not the behavior we need for our reports...the user needs to pick their selection. Can anyone shed some light on this, it seems to be an AJAX problem...I need to be able to have report parameters with a list of values, but no 'default' value on the parameter.

accesing controls on cotent pages using java script

i had a webform which used javascript for calander <head> <script language="javascript" src="Calendar.js" type="text/javascript"></script> </head> . . . <asp:TextBox ID="txtDateLeaving" runat="server" Enabled="false"></asp:TextBox> <a onclick="showCalendarControl(txtDateLeaving);" href="#"> <img src="calendar.gif" style="width: 20px; height: 20px" border="0" alt="cal" /></a> it was wrking perfectly . .but i am not able to run it using master pages.. when i try to access control on the content pageit says txtDateLeaving is not defined..can anybdy tell me how shld i achieve the same functionality using master n content pages..

Calendar.aspx page Refresh only Once + Java Script

Hi Experts, Following script works perfect (refresh only once after 5 seconds and stops but for some reason if somebody clicks next month then it keeps refreshing for 5 seconds. Can you please put the following code in your calendar.aspx page and check if you can get rid of the continuous refresh if somebody selects next month otherwise it works fine. Please provide the updated script <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Refresh test</title> <script type="text/javascript">   window.onload=function(){     url = window.location.href;     qIndex = url.indexOf("?");     if( qIndex != -1 ){       getData = url.substr(qIndex+1, url.length-1);       if(getData != "refreshed=1"){         refresh();       } else {         myDiv = document.getElementById('content');         myDiv.innerHTML = "This is the second and final time the page loaded.";       }    

how to check one time java script file download not every session

how to check one time java script file download not every session

form sliding using java script

how can we use sliding forms in asp.net

Problem registering client side script to interact with AJAX controls

Im using some animationExtenders in my project. The thing is, the objects to be animated are created programmatically, hence i need to also build programmatically the javascript code that will interact with them.It runs properly but, when i interact with these animated controls and the javascript functions are supposed to get to work, i keep getting the usual run-time error saying that the javascript functions are not defined. But, if i check the final html code generated, i can see how all the controls i built programmatically are there ,as well as the script.Tried both RegisterStartupScript and RegisterClientScriptBlock, no luck.Any advice? thanks in advance

Problem assigning a value to a variable in a Script Task

I've found loads of posts with the error I'm seeing: "The type of the value being assigned to variable [XXX] differs from the current variable type". However, I can't see anything that matches my scenario.  I'm simply trying to assign a value to a variable BEFORE passing the variable to an Execute SQL Task. I want to assign "true" or "false" to a Boolean variable called LogError, but as I got this error, I tried instead to assign 0 or 1 to it after converting it to an Int16 variable, but got the same result. I can see all manner of posts that make me wonder what I may have problems with next when I try to pass this variable to my stored proc that's expecting a BIT, but for now, I'd love SSIS to simply assign the value to the variable! Any ideas?

Problem running jquery script in Content Page

Hi!! I have a master page in asp.net and a content page with some basic asp.net controls like textbox,buttons,treeview....i have a jquery script in the content page and reference set to the jquery file..The script changes the text property of a button on the keydown event set for the textbox...the script works fine if i copy and paste it in a normal page...the script only ran once when i worte it for the first time the next day when i tried to run the script it was not working..i m facing this problem for running the script in content page and i a m not aware of how to write jquery script for the content page.. i m really not finding any solution where i am wrong i have even tried setting the internet explorer security setting to low..plz plz plz plz plz plz help me on Thanks!!

java script to call serverside function

hi i want java script by which i can call my asp.net (vb) function which i have written in aspx.vbi just using the vb function to change and check value of hiddenfild and other controln dont want to use ajax control toolkit , i wat to perform some action after spefic time interval

How to call java script in grid rowdatabound event

Guys I want some help on this issue my code goes like this protected void grdResults_RowDataBound(object sender, GridViewRowEventArgs e)    {        if (e.Row.RowType == DataControlRowType.DataRow)        {                       TextBox txtQty = e.Row.Cells[1].FindControl("txtQty") as TextBox;            Label lblTWeight = e.Row.Cells[9].FindControl("lblTWeight") as Label;            Label lblTMHRS = e.Row.Cells[10].FindControl("lblTMHRS") as Label;            Label lblTLabor = e.Row.Cells[11].FindControl("lblTLabor") as Label;            Label lblTMaterial = e.Row.Cells[12].FindControl("lblTMaterial") as Label;            Label lblTCost = e.Row.Cells[13].FindControl("lblTCost") as Label;            string onComp = "getTotalComplete(document.getElementById('" + txtQty.ClientID + "'));&q

Wizard Control and Java Script

Hi!Does enyone know if it is possible to get wizards next active step (that can be allso previous step when going back) width and height values in JavaScript?

Force report viewer to refresh through java script

I have a Report Viewer in Modal Popup Extender and I need to call refresh on the report viewer or simulate a postback. I have hidden fields tied to the Report viewer parameters, so I put my the report viewer in an update panel. And I need to find a way to refresh the report. My code is below...thanks for helping.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend