My web page includes JavaScript in the .aspx file for a save button. The source code declares a function called
OnClientClick="javascript: validateTextTest()"
, and this function is called in the head of the source code using validateTextTest()
.
Here is the save button in the source code:
<asp:Button ID="Save" runat="server"
onclick="Save_Click" Text="Save"
OnClientClick="javascript : validateTextTest()" Width="63px" />
Now I need to call the function validateTextTest()
in the save button of the .cs file because I have multiple textboxes. If one out of three textboxes is left empty, it should not insert into the database.
Can someone assist me with how to call the function in the .cs file?