Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
How to submit a form using JavaScript by clicking a link?
Home
JavaScript
How to submit a form using JavaScript by clicking a link?
0
votes
asked
Jun 9, 2022
in
JavaScript
by
sharadyadav1986
How to submit a form using JavaScript by clicking a link?
form-submission
javascript
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jun 9, 2022
by
sharadyadav1986
Let's see the JavaScript code to submit the form by clicking the link.
<
form
name
=
"myform"
action
=
"index.php"
>
Search:
<
input
type
=
'text'
name
=
'query'
/>
<
a
href
=
"javascript: submitform()"
>
Search
</
a
>
</
form
>
<
script
type
=
"text/javascript"
>
function submitform()
{
document.myform.submit();
}
</
script
>
Related questions
0
votes
Q: <form @submit.prevent=”validateSubmit”>…</form>
asked
Mar 6, 2022
in
VueJS
by
sharadyadav1986
form-submission
vuejs
0
votes
Q: How do you submit a form using JavaScript?
asked
Oct 1, 2023
in
JavaScript
by
GeorgeBell
javascript-interview-questions-answers
0
votes
Q: How Do You Submit A Form Using Javascript?
asked
Dec 3, 2019
in
JavaScript
by
rajeshsharma
#javascript-submit
0
votes
Q: How to write normal text code using JavaScript dynamically?
asked
Jun 9, 2022
in
JavaScript
by
sharadyadav1986
text-javascript
text-code
javascript
0
votes
Q: How can we detect OS of the client machine using JavaScript?
asked
Jun 9, 2022
in
JavaScript
by
sharadyadav1986
client-machine
javascript
0
votes
Q: Which of the following is the correct syntax to display "Letsfindcourse" in an alert box using JavaScript?
asked
Oct 8, 2022
in
JavaScript
by
rajeshsharma
alert-box
javascript
0
votes
Q: Javascript string using double quotes is exactly the same as a string using single quotes?
asked
Oct 9, 2022
in
JavaScript
by
Robin
javascript
string
0
votes
Q: what is the disadvantage of using innerHTML in JavaScript?
asked
Oct 10, 2022
in
JavaScript
by
SakshiSharma
javascript
0
votes
Q: What is divide by 0 in Javascript? var a = 10;
asked
Oct 9, 2022
in
JavaScript
by
Robin
javascript
0
votes
Q: What will be the output obtained by "shift ()" in the given code of JavaScript?
asked
Mar 22, 2021
in
JavaScript
by
Robindeniel
javascript
exception
output
...