Button click event
-
When I click once on button the event is not fired..when I click twice then only the event is fired...what culd the proble b? thanx
-
When I click once on button the event is not fired..when I click twice then only the event is fired...what culd the proble b? thanx
Hard to say, without seeing any code. No way does a button not fire until you click it twice.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hard to say, without seeing any code. No way does a button not fire until you click it twice.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
The code is in C# I have written a javascript code on click event of button following is the code: Also once condition is true i hv displayed a grid view getting data from db function checkDotOnly() { if (document.form1.txtcustomerName.length!=0) { if((document.form1.txtcustomerName.value==".")||(document.form1.txtcustomerName.value==". ")||(document.form1.txtcustomerName.value==" ")) { alert("Please Enter Valid Customer Name."); /*document.form1.lblErrMsg.value="Please Enter Valid Customer Name."; document.form1.lblErrMsg.disabled=false;*/ return false; } return true; } return true; } thanx
-
When I click once on button the event is not fired..when I click twice then only the event is fired...what culd the proble b? thanx
You might have coded under button_doubleClick You right the code under button_Click Try it out:):rose:
Vidya
-
You might have coded under button_doubleClick You right the code under button_Click Try it out:):rose:
Vidya
Hi Vidya, The code is written On Click event thanx
-
You might have coded under button_doubleClick You right the code under button_Click Try it out:):rose:
Vidya
vidya.p.nair wrote:
You might have coded under button_doubleClick
It's ASP.NET. Not windows app. In this you won't get double click event.:confused::confused:
-
The code is in C# I have written a javascript code on click event of button following is the code: Also once condition is true i hv displayed a grid view getting data from db function checkDotOnly() { if (document.form1.txtcustomerName.length!=0) { if((document.form1.txtcustomerName.value==".")||(document.form1.txtcustomerName.value==". ")||(document.form1.txtcustomerName.value==" ")) { alert("Please Enter Valid Customer Name."); /*document.form1.lblErrMsg.value="Please Enter Valid Customer Name."; document.form1.lblErrMsg.disabled=false;*/ return false; } return true; } return true; } thanx
ouch.. Very tough to read that script. Let me make it more clear
function checkDotOnly()
{
if (document.form1.txtcustomerName.length!=0)
{
if((document.form1.txtcustomerName.value==".") ||(document.form1.txtcustomerName.value==". ") ||(document.form1.txtcustomerName.value==" "))
{
alert("Please Enter Valid Customer Name.");
return false;
}
return true;
}
return true;
}I think last two
true
you are returning. That is making problem. Try writting this likefunction checkDotOnly()
{
if (document.form1.txtcustomerName.length!=0)
{
if((document.form1.txtcustomerName.value==".") ||(document.form1.txtcustomerName.value==". ") ||(document.form1.txtcustomerName.value==" "))
{
alert("Please Enter Valid Customer Name.");
return false;
}
else
return true;
}
else
return true;
}
-
The code is in C# I have written a javascript code on click event of button following is the code: Also once condition is true i hv displayed a grid view getting data from db function checkDotOnly() { if (document.form1.txtcustomerName.length!=0) { if((document.form1.txtcustomerName.value==".")||(document.form1.txtcustomerName.value==". ")||(document.form1.txtcustomerName.value==" ")) { alert("Please Enter Valid Customer Name."); /*document.form1.lblErrMsg.value="Please Enter Valid Customer Name."; document.form1.lblErrMsg.disabled=false;*/ return false; } return true; } return true; } thanx
hello miniThomas, Call that javascript in the Buton in onclientclick....It will work it is client side event..... ok byeee
-
vidya.p.nair wrote:
You might have coded under button_doubleClick
It's ASP.NET. Not windows app. In this you won't get double click event.:confused::confused:
Hi Guys, here is code: function checkDotOnly() { if (document.form1.txtcustomerName.length!=0) { if((document.form1.txtcustomerName.value==".")||(document.form1.txtcustomerName.value==". ")||(document.form1.txtcustomerName.value==" ")) { alert("Please Enter Valid Customer Name."); /*document.form1.lblErrMsg.value="Please Enter Valid Customer Name."; document.form1.lblErrMsg.disabled=false;*/ return false; } return true; } return true; } protected void imgbtnSearch_Click(object sender, ImageClickEventArgs e) { if (RadioButtonList1.SelectedValue.ToString() == "") { lblMsg.Text = ""; lblErrMsg.Visible = true; lblErrMsg.Text = "Please Select One Option."; PnlSearchResults.Visible = false; } else { if (RadioButtonList1.SelectedIndex.ToString() == "0" && ddlOrderNo.SelectedItem.Value == "-1") { lblMsg.Text = ""; lblErrMsg.Visible = true; lblErrMsg.Text = "Please Select Order Number."; PnlSearchResults.Visible = false; } else { lblErrMsg.Visible = false; fillSearchResults(); } if (RadioButtonList1.SelectedIndex.ToString() == "1") { if (txtcustomerName.Text == "") { lblMsg.Text = ""; lblErrMsg.Visible = true; lblErrMsg.Text = "Please Enter Customer Name."; PnlSearchResults.Visible = false; } else { lblMsg.Text = ""; lblErrMsg.Visible = false; fillSearchResults(); //Response.Write("domain=" + txtDomainName.Text + "cust=" + txtcustomerName.Text); } } } }//imgbtnSearch_Click thanx
-
Hi Guys, here is code: function checkDotOnly() { if (document.form1.txtcustomerName.length!=0) { if((document.form1.txtcustomerName.value==".")||(document.form1.txtcustomerName.value==". ")||(document.form1.txtcustomerName.value==" ")) { alert("Please Enter Valid Customer Name."); /*document.form1.lblErrMsg.value="Please Enter Valid Customer Name."; document.form1.lblErrMsg.disabled=false;*/ return false; } return true; } return true; } protected void imgbtnSearch_Click(object sender, ImageClickEventArgs e) { if (RadioButtonList1.SelectedValue.ToString() == "") { lblMsg.Text = ""; lblErrMsg.Visible = true; lblErrMsg.Text = "Please Select One Option."; PnlSearchResults.Visible = false; } else { if (RadioButtonList1.SelectedIndex.ToString() == "0" && ddlOrderNo.SelectedItem.Value == "-1") { lblMsg.Text = ""; lblErrMsg.Visible = true; lblErrMsg.Text = "Please Select Order Number."; PnlSearchResults.Visible = false; } else { lblErrMsg.Visible = false; fillSearchResults(); } if (RadioButtonList1.SelectedIndex.ToString() == "1") { if (txtcustomerName.Text == "") { lblMsg.Text = ""; lblErrMsg.Visible = true; lblErrMsg.Text = "Please Enter Customer Name."; PnlSearchResults.Visible = false; } else { lblMsg.Text = ""; lblErrMsg.Visible = false; fillSearchResults(); //Response.Write("domain=" + txtDomainName.Text + "cust=" + txtcustomerName.Text); } } } }//imgbtnSearch_Click thanx
-
Hi Vidya, The code is written On Click event thanx