how to submit value to another page without using form tag [JAVASCRIPT]
NickName:user3172337 Ask DateTime:2014-04-07T11:17:49

how to submit value to another page without using form tag [JAVASCRIPT]

Hii Everyone can help me ? How to submit value to another page without using form tag (method=post), so only using javascript.

function runScript(e) {
   if(e.keyCode==13){
      var text=document.getElementById('edtsearch').value
      // bla bla must be filled with function to submit value
   }
   return false
}

Copyright Notice:Content Author:「user3172337」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/22903046/how-to-submit-value-to-another-page-without-using-form-tag-javascript

Answers
Abe 2014-04-07T03:21:46

With jquery library: \n\nYou can use jquery POST request. \n\n$.ajax({\n type: \"POST\",\n url: url,\n data: data,\n success: success,\n dataType: dataType\n});\n\n\nWITHOUT LIBRARY, JUST PLAIN JAVASCRIPT.\n\nwindow.location = \"http://www.page.com\"; //this get another page\n\nform=document.getElementById('formName'); //this fills the form\n form.target='_blank';\n form.action='whatever.html';\n form.submit();\n form.action='whatever.html';\n form.target='';\n",


More about “how to submit value to another page without using form tag [JAVASCRIPT]” related questions

how to submit value to another page without using form tag [JAVASCRIPT]

Hii Everyone can help me ? How to submit value to another page without using form tag (method=post), so only using javascript. function runScript(e) { if(e.keyCode==13){ var text=document.

Show Detail

How can I get a value from a form in page 1 to another page by using JavaScript?

I have only learned HTML, CSS, JavaScript and jQuery and I want to get a value from my form to my index page, which is located in different files, using the languages I know. So this is my form : ...

Show Detail

Submit form with an anchor tag without refreshing page

I am trying to use basicModal to make a modal popup after my anchor tag is clicked on to submit a form. I originally had a button tag, but it seems to me that basicModal only works with anchor tags...

Show Detail

Submit value to another page iframe form

i want to submit a value to another page form from iframe look like this. <input form="form1" type="search><input form="form1" type="submit"> <iframe src="

Show Detail

Submit form using only PHP? Without JavaScript?

I have a form <form method='post' action='action.php' name='myForm'> <input type='' name='id' value='id'> <script>document.myForm.su

Show Detail

displaying value of an input on the form page without clicking submit

I’m creating a form. How can I make the value of an input display on the form page without clicking the submit button using php and maybe JavaScript

Show Detail

passing textbox values on the same page url without form or submit button using jquery or javascript

is there any ways to pass textbox values on the same page url without form or submit button i have javascript function but this function is working for drop down values not for text box values? i n...

Show Detail

How to create form with JavaScript and submit without reloading page

I created the form with JavaScript, but on submit the page reloads and rest of the codes doesn't run. Creating and submitting this form is for passing JavaScript value to PHP. How can I submit this

Show Detail

use a tag to submit form to other page

I wanted to use an a tag to submit a form to another page. However, when I do this, and use href="" to go to this page, the form seems not to be submitted. It looks like this: <form id="SomeForm"

Show Detail

Using Javascript to submit a form

im working on a project using mvc asp.net and what i try to do now is to submit a form using javascript. the javascript works and submit my form. My problem is that i have a value in my button tag

Show Detail