Note that there are some explanatory texts on larger screens.

plurals
  1. POwindow.location.href using GET when I need POST
    primarykey
    data
    text
    <p>I have the following script, a few lines up from the bottom I have a <code>window.location.href</code> which posts the reults from my form though the address bar. This is very messy and I would like to use POST instead of GET, any ideas anyone ?</p> <pre><code>&lt;script language="javascript"&gt; function OnChangedUsername() { if(document.signup.newuserid.value == "") { document.signup.btnCheckAvailability.disabled = true; } else { document.signup.btnCheckAvailability.disabled = false; } } function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); function sndReq() { http.open('get', 'password_check.asp?emailaddress=&lt;%Response.Write(emailaddress)%&gt;&amp;check=&lt;%Response.Write(check)%&gt;&amp;password_check='+document.signup.newuserid.value); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4){ var response = http.responseText; var update = new Array(); if(response.indexOf('|' != -1)) { update = response.split('|'); document.getElementById("username_chk").innerHTML = update[0]; if(document.getElementById("username_chk").innerHTML == "Ok") { window.location.href='detailsupdate.asp?username=&lt;%Response.Write(sUsername)%&gt;&amp;check=&lt;%Response.Write(check)%&gt;&amp;EmailAddress='+document.signup.EmailAddress.value+'&amp;Address='+document.signup.Address.value+'&amp;Address1='+document.signup.Address1.value+'&amp;Address2='+document.signup.Address2.value+'&amp;City='+document.signup.City.value+'&amp;PostalCode='+document.signup.PostalCode.value+'&amp;Country='+document.signup.Country.value+'&amp;WorkPhone='+document.signup.WorkPhone.value+'&amp;HomePhone='+document.signup.HomePhone.value+'&amp;MobilePhone='+document.signup.MobilePhone.value+'&amp;FaxNumber='+document.signup.FaxNumber.value+'&amp;AlternativePhone='+document.signup.AlternativePhone.value+'&amp;OO='+document.signup.OO.checked+'&amp;Workshop='+document.signup.Workshop.checked+'&amp;Raised='+document.signup.Raised.checked+'&amp;Ground='+document.signup.Ground.checked+'&amp;pd='+document.signup.newuserid.value+'&amp;Tram='+document.signup.Tram.checked; } } } } &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload