Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML form has no action string?
    text
    copied!<p>I want to write an application with java to send POST method to a URL . The problem is that there is no action string . I wrote the java code below to programmatically sign in to the site but it does not work . Any information can help .</p> <p>This is the form and validation:</p> <pre class="lang-html prettyprint-override"><code>&lt;form method="post" action="" name="login_form" id="login_form" onSubmit="return ValidateForm();"&gt; &lt;input type="text" name="email" id="login_email" value="" class="txt" /&gt;&lt;/td&gt; &lt;input type="password" name="password" id="login_password" value="" class="txt" /&gt;&lt;/td&gt; &lt;select name="lang" id="lang"&gt; &lt;option value="en" label="English" selected="selected"&gt;English&lt;/option&gt; &lt;option value="Fr" label="French"&gt;French&lt;/option&gt; &lt;/select&gt; &lt;button type="submit"&gt;Login&lt;/button&gt; &lt;/form&gt; </code></pre> <pre class="lang-js prettyprint-override"><code>function ValidateForm(){ var emailID=document.login_form.email var ps=document.login_form.password if ((emailID.value==null)||(emailID.value=="")){ alert("Please enter email address"); emailID.focus(); return false } if (ps.value==''){ ps.focus(); alert("Please enter password"); return false } return true } </code></pre> <p>This is my client application which uses org.apache.http and is written in java :</p> <pre><code>HttpPost hpost = new HttpPost("http://something.com/"); List &lt;NameValuePair&gt; nvps = new ArrayList &lt;NameValuePair&gt;(); nvps.add(new BasicNameValuePair("email", "myemail@yahoo.com")); nvps.add(new BasicNameValuePair("password", "blahblahblah")); nvps.add(new BasicNameValuePair("lang", "en")); hpost.setEntity(new UrlEncodedFormEntity(nvps,Consts.UTF_8)); Myresponse = Myhttpclient.execute(hpost,MyHttpContext); </code></pre>
 

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