What function does a submit button call? [closed] - html

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 8 years ago.
Improve this question
I want to create my custom submit button. So I need to know what javascript function does the input type submit button call? I don't want a css customized submit button if possible.

In Case your HTML Looks like this:
<form id="myform" name="myform" action="destination.html">
<input id="sub_Button" type="button" value="clickme" onclick="mySubmitFunction();" />
</form>
Do you mean JavaScript?
document.myform.submit();
Or JQuery?
$("#myform").submit();

Related

how can I prevent a user to type 0 as the first character in a text input using vanilla javascript? [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 have this html block:
<div class="form-group flex-auto" >
<input maxlength="2" class="form-control format__itemForm" type="text" ng-model="$ctrl.codigoPaisTelefono" prevent-keys="{{ $ctrl.caracteresExcluidos }}"
required oninput="this.value== 0? this.value == '' :void(0)"
>
</div>
I need to prevent users to type 0 as the first character, I tried oninput method above, but didn't work.
Any clue?
Something like this maybe?
function validate(element){
var val = element.value;
if(val.charAt(0)=='0'){
element.value=val.substring(1, val.length);
}
}
<input oninput="validate(this)">

how to make input field required which is in Bootstrap Modal? [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 4 years ago.
Improve this question
Before submitting the form user would know that model fields all mandatory that he/she as to fill out first before submitting the form.
If you want to make required fields on a form, all you have to do is add required="required" in the <input> tags.
Doing this kind of custom message can only be done in the <input> tag, using the oninvalid attribute. Do this:
<input type="text" oninvalid="alert('Hey, you missed something on modal!')" required="required">

HTML button don't submit [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 6 years ago.
Improve this question
I have this HTML code in a JSP page, but when I click it does not do anything
<button class="btn btn-grey" type="submit">Save device</button>
Hello Amadeu Cabanilles,
You have to put your button into form.
<form class="form-horizontal" method="post" modelAttribute="modelName" action="/submitSomeWhere">
<button type="submit" class="btn-lg btn-primary pull- right">Update</button>
</form>
Do you have proper form tags in your html , correct form post should be :
<form id="createMarkerForm"
method="post"
accept-charset="utf-8"
action="servletUrl">

is there any alternated method for anchor tag?(Deleted) [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 8 years ago.
Improve this question
This is my sample html page where i'm using anchor tag inside but i need any alternate method instead of anchor tag,could anybody tell me.
<body>
<table><tr><td>
<a href="http://www.w3schools.com">Visit W3Schools.com!
<div></div>
</a>
</td></tr>
</table>
</body>
Thanks for your help.
Maybe you could use:
<form method="GET" action="foo.html">
<input type="submit" />
</form>
The difference between those two methods: <form method="link" > or <a>? What's the difference?

open form in new popup window of small size [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 1 year ago.
Improve this question
I want to open new url as a popup window on form submission. Can you please help me .
The FORM tag allows an onSubmit event handler which you can process JavaScript in.
You could do something like
<form ... onsubmit="return submitWindow">
</form>
And the JavaScript for opening the window
<script>
function submitWindow() {
..
// URL, name and attributes
window.open('http://www.stackoverflow.com','windowNew','width=300, height=300');
return true;
}
Have a look at for more information on onSubmit:
http://www.htmlcodetutorial.com/forms/_FORM_onSubmit.html
You could also add the window.open on your submit button using the onClick event.
source
function open_win(url_add)
{
window.open(url_add,'welcome',
'width=300,height=200,menubar=yes,status=yes,
location=yes,toolbar=yes,scrollbars=yes');
}
<form onsubmit="open_win('http://url')" ...>
If you want to submit the form depending popup open, then you must return true/false from the respective function(here open_win(url_add)).
And you have to use the return keyword on submit attr like - onsubmit="return open_win('url')
use target attribute for form
<form ... onsubmit="return submitWindow" target="_new">
</form>