Text ID = Password... will not work? [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
The password input isn't working... check it:
<div class="form">
<h2>Login Form</h2><br />
<form method="POST" id="login-form">
<input type="text" id="username" name="username" placeholder="Username">
<input type="text" id="password" name="password" placeholder="Password">
<input type="submit" value="Login">
</form>
I apologize for being unclear.
Thanks!

You are missing type here. To get password field,Input type should be password
Try like this
<input type="password" id="password" name="password" placeholder="Password">

Add type="password" instead of type="text". See demo

Related

Creating an HTML form to interact with REST API [closed]

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 7 months ago.
Improve this question
I am trying to write an HTML form to interact with a REST API.
This is what I have so far, but I'm not sure what I need to do to actually get it to interact with the REST API, how do I link them?
<!DOCTYPE html>
</html>
<head>
</head>
<body>
<form id="myForm">
<label for="name">Name</label><br>
<input type="text" id="name" name="name"><br>
<label for="password">Password</label><br>
<input type="text" id="password" name="password"><br>
</form>
</body>
You are almost there. First of all, your form needs to be submittable. You can achieve this by adding a submit input:
<!DOCTYPE html>
</html>
<head>
</head>
<body>
<form id="myForm" action="/action_page.php">
<label for="name">Name</label><br>
<input type="text" id="name" name="name"><br>
<label for="password">Password</label><br>
<input type="text" id="password" name="password"><br>
<input type="submit" value="Submit">
</form>
</body>
Now, your structure is ready to be used. On the other end, you have a RESTful API, which should handle properly the request your form is sending. You can achieve that using the action attribute of your form tag.

How to make a contact form in javascript and html [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
//IT would be very helpful if when the user clicks submit the form is sent to webdyno5#gmail.com
<div id="contact-box">
<form action="">
<div class="form-group" id="name">
<label for="name">Name: </label>
<input type="text" name="name" id="name" placeholder="Enter your name">
</div>
<div class="form-group" id="email">
<label for="email">Email: </label>
<input type="email" name="name" id="email" placeholder="Enter your email">
</div>
<div class="form-group" id="subject">
<label for="Subject">Subject of Email: </label>
<input type="text" name="name" id="subject" placeholder="Enter the subject of your Email">
<div class="form-group" id="message">
<label for="message">Message: </label>
<textarea name="message" id="message" cols="30" rows="10"></textarea>
<input class="submit" type="submit" value="Submit">
</div>
</form>
</div>
</section>
JavaScript can't do email and there's no way of sending info to email directly by html.
You can use PHP at backend.
For this segment of code you are showing, try with
As for details, please refer to:
https://html.form.guide/email-form/html-email-form.html

How can I make first number of phone number cannot be zero? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
My html like this :
<input type="number" />
I had validation number, so user only input number. I want the first digit to be non-zero
How can I do it?
You can use text input with a pattern attribute:
<form action="/action_page.php">
Phone Number: <input type="text" name="phone_number" pattern="[1-9][0-9]+" title="Phone number without a leading zero" required="required">
<input type="submit">
</form>
and to use with number you can use this:
<input type="number" oninput="this.value = this.value.replace(/^0/g, '');" >

Toggle button if checkbox is check [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
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.
Improve this question
I made a sign up form and i want to allow user to press the create account button only if he check the checkbox and if not the button is unclickable.The form looks like this:
<input type="text" name="nume" value="" placeholder="Nume" /><br />
<input type="text" name="prenume" value="" placeholder="Prenume" /><br />
<input type="text" name="username" value="" placeholder="Username" /><br />
<input type="password" name="password1" value="" placeholder="Parola" /><br />
<input type="email" name="email1" value="" placeholder="E-mail" /><br />
<input type="checkbox" name="reguli" id="reguli" required >
<label for="reguli">I agree with the website rules</label><br />
<input type="submit" name="cont" value="Creare cont" />
Found what I search : Toggle Button
Give id to your button like
<input type="submit" name="cont" id="btnsubmit" disabled="true" value="Creare cont" />
Then add following code to your javascript and you are done
$("#reguli").change(function(){
$("#btnsubmit").prop("disabled",!this.checked);
});
Fiddle here
use the jquery validate plugin
$('#signup form').validate({
rules: {
reguli: {
required: true,
}}});

how to check html5 form validity with vanilla javascript? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
HTML:
<form id="myform" method="post">
<input name="email" type="email" required=""/>
<input name="fname" type="text" required="" />
<input name="zip" type="text" />
<input type="button" value="button" />
</form>
Here I want to just check email by applying javascript function for html5 can we do that?
Edit
It has been unclear/misunderstood before. My question is do we have boolean valid check like form.email.valid() so that we can do check for email only with using javascript?
You should change your button input. A HTML5 submit button needs to look like the following:
<button type="submit">Submit</button>
Also, giving your e-mail a placeholder would be nice:
<input name="email" type="email" placeholder="me#example.com" required=""/>
Example jsFiddle.

Categories

Resources