Question : Javascript kills my submit button?

I have an external javascript file for some validation. It will alert the user just fine if they missed a textbox or put in bad data. But once you correct the problem and click the "Add" button, it won't add the textbox values to the array and move on to the next page like it's supposed to.

I've tried adding it to the button's onclick event, but it gives me a compliation error:
"'return' is not a member of 'ASP.default_aspx'."

1:
2:
 <asp:Button ID="AddButton" runat="server" Text="Add Barn" UseSubmitBehavior="False"
                            onclick="return validate();"/>
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
function validate() {
 if (document.getElementById("FNameTextbox").value=="")
      {
                 alert("First name is required");
                 document.getElementById("FNameTextbox").focus();
                 return false;
      } 
 if (document.getElementById("LNameTextbox").value=="")
      {
                 alert("Last name is required");
                 document.getElementById("LNameTextbox").focus();
                 return false;
      }
 if (document.getElementById("BarnNumberTextbox").value=="")
      {
                 alert("Barn number is required");
                 document.getElementById("BarnNumberTextbox").focus();
                 return false;
      }
 else return true;
}
1:
2:
3:
4:
5:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

AddButton.Attributes.Add("onclick", "return validate()")

End Sub

Answer : Javascript kills my submit button?

Unless there is a third party apps to do this, it is not available on the Blackbrry unit itself.
Random Solutions  
 
programming4us programming4us