Solved

Stop a submit

Posted on 2008-10-29
1
207 Views
Last Modified: 2008-10-29
Hi
I have an ASP.NET using Visual Basic.Net and I have a form on a page.
I want the form to be check so details when I click submit so I do this ...

btnSubmit.Attributes.Add("onClick", "alert('!!!');return false;")

that works fine. It doesn't submit.

But if I try

btnSubmit.Attributes.Add("onClick", "checkForm();")

and then in the javascript do this

function checkForm()
    {
        alert('test!');
        return false;
    }

It submits!
I can't understand why.

Any ideas?
Thanks
AM
0
Comment
Question by:amoran
1 Comment
 
LVL 15

Accepted Solution

by:
Tomarse111 earned 20 total points
ID: 22829484
Try the below:
btnSubmit.Attributes.Add("onClick", "return checkForm();")

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now