How can I hide hint in input form? - html

When I fill input login form, input form shows me previous login. How can I hide or don't display previous login.
I try to change type of input to type = "hidden", but this hide was displayed like password type;
<form method="POST">
<label for = "adminLogin">Login: </label>
<input name = "adminLogin" type="hidden" >
<input type="submit" value="Log in">
</form>

You can use autocomplete="off" to tell the browser not to show suggestions:
<form method="POST">
<label for = "adminLogin">Login: </label>
<input name = "adminLogin" autocomplete="off" >
<input type="submit" value="Log in">
</form>

Related

How to add additional query string to form input from html page?

I am trying to recreate the google search form for images, and can't get the image query string to be included in the search. Currently what I have will only return the normal Google search results and omits the &tbm=isch query. However, when I go to https://www.google.com/search?q=cat&tbm=isch the image results are returned
How can I add the &tbm=isch query string from the HTML form?
<form action="https://www.google.com/search?tbm=isch&q=">
<input style="border-radius: 10px;" type="text" name="q">
<input type="submit" value="Google Image Search">
</form>
You have q twice
EITHER add the field as hidden
<form action="https://www.google.com/search">
<input style="border-radius: 10px;" type="text" name="q">
<input type="hidden" name="tbm" value="isch" />
<input type="submit" value="Google Image Search">
</form>
OR use JS to load the URL
document.getElementById("imgSearch").addEventListener("submit", function(e) {
e.preventDefault();
const q = this.q.value.trim();
if (q) location = `https://www.google.com/search?tbm=isch&q=${q}`
})
<form id="imgSearch">
<input style="border-radius: 10px;" type="text" name="q">
<input type="submit" value="Google Image Search">
</form>

How can I add text to a entered input value

How can I add a string to the text written by the user of my form?
For example, if he wants to search for "test", my form should submit "site:mysite.de test".
(The name where I'm trying to send the string to is q.)
I tried with
<form action="https://searx.me" method="get" accept-charset="UTF-8">
<input type="text" name="q" placeholder="Search with Searxes" required>
<input type="hidden" name="q" value="site:mysite.de">
</form>
How expected only the first value is submitted https://searx.me/?q=test
I would prefer a solution with pure html without javascript.
Here is an ugly way to do that, looks like binding ;)
var hidden = document.getElementsByClassName('hidden')[0];
var hidden_attr = hidden.getAttribute('value');
var show = document.getElementsByClassName('show')[0];
function magic(){
hidden.setAttribute('value', hidden_attr + show.value);
console.log(hidden.getAttribute('value'));
}
<form action="https://searx.me" method="get" accept-charset="UTF-8">
<input class="show" onkeyup="magic()" type="text" name="q" placeholder="Search with Searxes" required>
<input class="hidden" type="hidden" name="q" value="site:mysite.de ">
</form>

html- input tag drop down not showing for previous entered values

My input tag in a form is not showing the suggestions for previous entered values
<form target="temp" method="post" action="">
<input id="UserID" name="UserID" type="text" placeholder="User ID" autocomplete="on" spellcheck="false">
<input id="Password" type="password" placeholder="Password" spellcheck="false">
<input type="button" value='Submit' onclick="login();">
</form>
What is happening is:
I want it to be:
You can make most browsers display values previously entered in input fields by giving a name to the input.
Change first input to this:
<input id="UserID" name="UserID" type="text" placeholder="User ID" spellcheck="false">
UPDATE
Not sure what your onClick function is doing but...
Change type="button" to type="submit":
<input type="submit" value='Submit' />

Hide form input fields from URL

I've got a login form with two input fields: username and password.
<form method="get" action="../Main/Index">
<p>
<input type="text" name="username" value="" placeholder="username" maxlength="30"></p>
<p>
<input type="password" name="password" value="" placeholder="password" maxlength="25"></p>
<p class="submit">
<input type="submit" name="commit" value="Enter">
</p>
</form>
Once the user submits the form, his username and password are shown in the browser's URL textbox, something like this:
http://localhost:53997/Main/Index?username=zm&password=123456789&commit=Enter
I don't want his username and password to be on display.
How can I do this?
the problem is that youre using form method = "get" when you should be using form method = "post" instead.
this explains it:
http://msdn.microsoft.com/en-us/library/ee784233(v=cs.20).aspx

Passing parameter and user input

I am trying to pass a few parameter and a user input to a search_form.asp page.
<form action="search_form.asp" method="Post">
<input type="text"name="fname"/></th>
<input type="submit" value="Update">
</form>
And on search_form.asp...
lname=request.QueryString("Lname")
fname=request.form("fname")
But I am unable to see lname when i place Response.Write("<p>Name: " & lname) in search_form.asp
The query string is not preserved when you submit the form, so search_form.asp will not have a query string. As an alternative, could you include the query string as a hidden field:
<form action="search_form.asp" method="Post">
<input type="text"name="fname"/></th>
<input type="submit" value="Update">
<input type="hidden" name="lname" value="<%=Request.QueryString("lname")%>" />
</form>
And then refer to Request.Form("lname") in search_form.asp.
Alternatively, could you include the query string in the form action?
<form action="search_form.asp?<%=Request.ServerVariables("QUERY_STRING")%>" method="Post">
<input type="text"name="fname"/></th>
<input type="submit" value="Update">
<input type="hidden" name="lname" value="<%=Request.QueryString("lname")%>" />
</form>
This should pass the query string on the original page when the form is submitted.