What is onSubmitCheck for? [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm working on a form which has this code in the submit button :
<input type="submit" onclick="return onSubmitCheck(document.forms['name'])">
When I delete this part onclick="return onSubmitCheck(document.forms['name'])" it works as normal as before so I don't have any idea what is that for.
Is it for security of form or something else?
Is it ok to remove it?

From the look of it, it is a JavaScript function which is suppose to run when you click on the submit button. You need to look at your JavaScript files and find the function and see what it does.
Whether it is safe to remove or not, depends on what it does.

Related

Javascript code for pressing a button? How can I do? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am new to Javascript, so I am wondering if anyone could give me some code to press a button! (Not code to have an event on a click, but to have javascript automate a click) Any help would be great!
Given:
<button id="myButton"></button>
When:
document.getElementById("myButton").click();
Then the button's onclick handler will fire.
References:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click

Need Assistance with one click button [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have a site with multiple and users and i want to build a feature but i don't know how to make a button that when you click it one time you can't click it anymore, once you click it, it runs the function and just disappears like something that shows in database so it will happen to all users.
You want a button that disappears when clicked:
<button onclick="this.style.display = 'none';">Click me!</button>
That should do it. If you also want it to run a function, do this:
<button onclick="this.style.display = 'none';myFunction();">Click me!</button>
Where myFunction() is your javascript function.

Does disabling javascript in browsers affect jQuery? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I know user disabled the JavaScript in his browser, it leads to disabled the JavaScript validations on client side. Whether it may affect the jQuery validations or not and I need to know conceptual explain.
Yes, jQuery is a Javascript library, so if Javascript is switched off in the browser, then jQuery will not run.

jQuery/Javascript border around empty form fields [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Recently I decided to learn Javascript and have been trying to create a script that will put a border around empty elements before the form is submitted. Essentially I want the form to be live validation and notify the user before they click submit. Any help would be greatly appreciated.
There are very many plugins if you want to use jQuery as your title suggests:
http://www.jquerybyexample.net/2014/05/15-useful-jquery-validation-plugins.html
Just pick whatever you want :-)
Or if you want to use plain JS, just search "javascript form validation" on google, you'll find thousands of entries, e.g.
http://www.learn-javascript-tutorial.com/javascript-form-validation.cfm and http://www.tizag.com/javascriptT/javascriptform.php

How to remove data from form field after refreshing? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I made a form with text fields,i want that data in the form should clear after pressing F5 key.
By reloading this is happening.
Any suggestion......
The F5 is under the control of the browser so you can't do anything about it. But you can place a reset button on your form.
Use the autocomplete="off" attribute. See also How to Turn Off Form Autocompletion at MDN.

Categories