Username Password Button [closed] - html

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm working on HTML and I'm trying to introduce a box in the middle of the page with two text buttons to insert username and password. I find the way to create the box with the text inside, like the one that disappear when you click on it. How can I do it? Thanks for all!
I was able to create the button and the onClick option for the Tune In but I don't know how to do the two text buttons

That's not a button but instead an input. You can insert them inside your form like this:
<form action="#">
<input type="text" placeholder="Username" />
<input type="text" placeholder="Password" />
</form>

As suggested in the comments, use the placeholder attribute
<input type="text" name="username" placeholder="Username">
For the password you can also add a password type to prevent the plain text from appearing
<input type="password" name="pwd" placeholder="Password>
So
<form action="#" style="text-align:center">
<input type="text" name="username" placeholder="Username"><br>
<input type="password" name="pwd" placeholder="Password">
<div class="button">
<button type="submit">Tune In</button>
</div>
</form>
The above code is now centered per your request. You can put the styling in CSS as well

input[placeholder] {
font-size: 20px;
text-align: center;
}
<input type="text" name="username" placeholder="username"></p>
<input type="text" name="password" placeholder="password"></p>
EDIT
To increase the placeholder's font size and center the text:
input[placeholder] {
font-size: 20px;
text-align: center;
}

Here is how it will work
<input type="text" placeholder="Enter User Name">
and I think you should make your password text box of password type as follows
<input type="password" placeholder="Enter password">

or another aproach if you want to include a little jquery so it will be old browsers compatible.
html:
<form action="#">
<input type="text" class="txtInside" defaultval="user" >
<input type="text" class="txtInside" defaultval="pass" >
</form>
jquery:
$('body').ready(function () {
$('.txtInside').each(function () {
$(this).val($(this).attr('defaultVal'));
$(this).css({ color: '#999999' });
});
$('.txtInside').focus(function () {
if ($(this).val() == $(this).attr('defaultVal')) {
$(this).val('');
$(this).css({ color: '#000' });
}
});
$('.txtInside').blur(function () {
if ($(this).val() == '') {
$(this).val($(this).attr('defaultVal'));
$(this).css({ color: '#999999' });
}
});
});
Example: http://jsfiddle.net/fhs43ke8/
In thsi case you write the test you want in "defaultval". the script include a change of text color in case you want it

Related

How can I increase the size of form text boxes? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I am currently trying to implement a simple feedback form for my site. However, the boxes are very small and don't really match the theme of my site at all. I have tried increasing text size and margin with CSS, but I can't seem to make them larger.
Any help would be greatly appreciated!
<form action="form" method="POST" class="formone">
<input type='text' name='name' placeholder='John Doe' /><br/>
<input type='text' name='message' placeholder='Your message'/><br/>
<input type='submit' value='submit' />
</form>
You can modify it by giving them a class and then defining the font-size for those classes.
For example:
.one{
font-size: 20px;
}
.two {
font-size: 40px;
}
<form action="form" method="POST" class="formone">
<input class="one" type='text' name='name' placeholder='John Doe' /><br/>
<input class="two" type='text' name='message' placeholder='Your message'/><br/>
<input class="three" type='submit' value='submit' />
</form>
I hope it helps.
Edit:
You can also try using inline style like this if it's not working due to some other style statement overriding this:
<form action="form" method="POST" class="formone">
<input style="font-size:20px !important;" type='text' name='name' placeholder='John Doe' /><br/>
<input style="font-size:30px !important;" type='text' name='message' placeholder='Your message'/><br/>
<input type='submit' value='submit' />
</form>
I would recommend to use textarea and using text area you can set height and width of it.
<textarea name="message" rows="10" cols="30">
The cat was playing in the garden.
</textarea>
In text area rows and cols are set as default textarea size and it is expandable.
As you have used <input type='text'/> It does not holds property of height and width so you cannot change it with css.
For better understanding refer these two links : https://www.w3schools.com/tags/att_input_width.asp
https://www.w3schools.com/html/html_form_elements.asp
Hope it helps
Thanks

How to align form input in HTML

I am struggling to align the input on this form. I've tried many things but none of them worked.
If anyone can help me fix this that will be great. Please find attached the code and the form
enter image description here
enter image description here
[
<form action="" method="post" enctype="text/plain">
<label>First Name</label>
<input type="text" name="Your Name" value=""><br/>
<labe>Last Name</label>
<input type="text" name="Last Name" value=""><br/>
<label>Contact Number</label>
<input type="value" name="Contact Number" value=""><br/>
<label>Email address</label>
<input type="email" name="Email" value=""><br/>
<label>Date of the application</label>
<input type="date" name="Date"><br>
<label> Add your message</label><br>
<textarea name="Message" rows="10" cols="30"></textarea><br>
<label>Have you read the terms and condition of the website?</label>
<input type="checkbox" name="box"><br>
<label>Submit application</label>
<input type="submit" name="">
</form>
]3
How to align input forms in HTML
This question has been already answered before. If you could elaborate a little bit of what you have tried and what failed then it might be helpful.
Your question is not understand clearly, but it seems you want to align label and input for all the places with equal space between the two items right?
I modified your code and I created the new code, look at this you will get some idea. This will give equal space between the label and input.
HTML code:
<div class="form-label">
<label>Name</label>
<input type="text" name="">
</div>
CSS code:
label {
color: #000;
width: 50%;
float: left;
}
.form-label {
width: 100%;
display: inline-block;
}
input {
width: 50%;
}

Text input doesn't work in Chrome

I have a problem with my website and I don't get it why it doesn't work.
I have two separate domains with the same WordPress theme (http://takoplius.lt and http://takoplius.ru). The interesting thing when I load pages on Chrome browser .lt version contact form inputs are not working, but in .ru version, everything works just fine with contact form and I can type text in inputs. When I try to load the .lt page in Firefox, contact form works just fine there.
Here is my form code:
<form method="post" id="kontaktu_forma" onsubmit="send_email('<?=$lang;?>'); return false;">
<label><?=$vardas_pavarde;?>: </label>
<input class="input" type="text" name="vardas" />
<label><?=$imones_pavadinimas;?>: </label>
<input class="input" type="text" name="imone" />
<label><?=$adresas_aa;?>: </label>
<input class="input" type="text" name="adresas" />
<label><?=$telefono_nr;?>: </label>
<input class="input" type="text" name="phone" />
<label><?=$el_pastas;?>: </label>
<input class="input" type="text" name="email" />
<label><?=$dominancios_paslaugos;?>:</label>
<textarea class="input" rows="5" name="klausimas"></textarea>
<input type="button" class="button" value="<?=$siusti;?>" onclick="send_email('<?=$lang;?>'); return false;" style="margin-left: 15px;" />
</form>
It would be great if someone helps me with this issue.
Thanks!
you have to change this
jQuery(function($) {
$('body').disableTextSelect();
});
To
jQuery(function($) {
$('#main').disableTextSelect();
});
not only your input selection is disables but you cant select any text from that website
because your are disabling text selection from js, I found below code in your website, you remove this code and it will fix your problem
jQuery(function($) {
$('body').disableTextSelect();
});
just remove or comment out above code.

Why isn't my padding working? (HTML & CSS) [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
On my website, I have created a sidebar. However, I want a padding of 40px between the content in the sidebar and the border of the sidebar. I have tried this but for some reason, it didn't work. What's going on?
My code:
.sidebar {
padding: "40px 40px 40px 40px";
}
<div id="sidebar">
<form id="signUp" name="signUp">
<p>
<b>Hey!</b> Want to post comments and receive cool information about me? If You Do, Sign Up Now! :D<br>
<br>
Nickname: <input id="nickname" placeholder="Nickname" required="" type="text"><br>
Email Address: <input id="email" maxlength="254" placeholder="Email Address" required="" type="text"><br>
Password: <input id="password" placeholder="Password" required="" type="password"><br>
<input onclick="confirmAccount" type="button" value="Submit">
</p>
</form>
</div>
Using the correct selector (# instead of .) and removing the quotes and then this should work.
#sidebar {
padding: 40px 40px 40px 40px;
}
<div id="sidebar">
<form id="signUp" name="signUp">
<p>
<b>Hey!</b> Want to post comments and receive cool information about me? If You Do, Sign Up Now! :D<br>
<br>
Nickname: <input id="nickname" placeholder="Nickname" required="" type="text"><br>
Email Address: <input id="email" maxlength="254" placeholder="Email Address" required="" type="text"><br>
Password: <input id="password" placeholder="Password" required="" type="password"><br>
<input onclick="confirmAccount" type="button" value="Submit">
</p>
</form>
</div>
Remove your `"'s...
Try #sidebar { padding: 40px 40px 40px 40px; } instead.
Or you can just use #sidebar { padding: 40px; } as you need all sides padding 40px...
First of all your div has an id so use # instead of .. Second remove the quotes from the padding values - as they are all the same you can just use one 40px value. The folllowing should work:
#sidebar {
padding: 40px;
}
You have put .sidebar in your css style, which is a tag associated with a class (.).
For ids, such as your sidebar, always use a hash (#) to identify them in CSS. In this case you need to put #sidebar instead of .sidebar in your code.

HTML hiding form under text information

I would like to make this form below
<form enctype="application/x-www-form-urlencoded" action="http://cpanel.gateway245.com/auth" method="post">
<p class="element">
<label for="email">Email address</label>
<br/>
<input type="text" name="email" id="email" value="" placeholder="E-mail">
</p>
<p class="element">
<label for="password">Password</label>
<br/>
<input type="password" name="password" id="password" value="" placeholder="Password">
</p>
<input type="submit" name="submit" id="submit" value="Login">
</form>
So that when a link is clicked the form shows I have seen some websites with login forms like this is it possible to be done in html under div menu ui?
Showing/hiding content can't be done in HTML alone - you'll need JavaScript to handle the click event.
This is a rudimentary example to get you on the right track. Many, many, many more examples are on SO already.
CSS
#ttt { display: none; }
HTML
Click to show form
<form id="ttt"> ... </form>
JavaScript
function show(target){
document.getElementById(target).style.display = 'block';
}