Linking a Button to a website and keeping the style - html

Hey Everyone: I'm working on a simple login system and wanted to keep my styled buttons inline with each other in the form but assign different actions to them. Is this possible? Obviously the following code won't work as written. I want the login button to link to my login.php script and my sign-up button to link to the signup.html page.
<form action="login.php" method="post">
Username:
<input name="username" type="text" class="clear" size="20">
<br><p></p>
Password:
<input name="password" type="password" class="clear" size="20"><br><p></p>
<input name="login" type="submit" id="login" value="Log In">
<input name="signup" type="button" id="signup" value="Sign Up">
</form>
As always thanks so much!

You can use javascript for doing this
HTML
<form action="login.php" method="post">
Username:
<input name="username" type="text" class="clear" size="20">
<br><p></p>
Password:
<input name="password" type="password" class="clear" size="20"><br><p></p>
<input name="login" type="submit" id="login" value="Log In">
<input name="signup" type="button" id="signup" onclick="loadsign();" value="Sign Up">
</form>
you can use this JAVASCRIPT
<script type="text/javascript">
function loadsign(){
window.location.assign( provide path of html file );
}
</script>
Hope this could help you !
I have changed code a bit hope it could deliver.

Related

Even using the simple example on the site my submit button doesn't send

My Formsubmit doesn't work.
Even using the simple example on the site my submit button doesn't send. I can't even send the verification to my email.
I'm using Angular.
<form action="https://formsubmit.co/matheusproencaescola#hotmail.com" method="POST">
<input type="text" name="name" required>
<input type="email" name="email" required>
<button type="submit">Send</button>
</form>
EDIT: he problem is the button seems to have no function, it doesn't work at all.
I know it is a little late, but try this:
<form #form action="https://formsubmit.co/matheusproencaescola#hotmail.com" method='POST'>
<input type="text" name="name" required>
<input type="email" name="email" required>
<button type="submit" (click)="form.submit()">Send</button>
</form>
Try replace
<button type="submit">Send</button>
by:
<input type="submit" value="Send"/>
Complete Code:
<html>
<body>
<form action="https://formsubmit.co/matheusproencaescola#hotmail.com" method="POST">
<input type="text" name="name" required/>
<input type="email" name="email" required/>
<input type="submit" value="Send"/>
</form>
</body>
</html>
Edited: Right! I used button tag and it works too.
When I click on button, it redirects to:
https://formsubmit.co/matheusproencaescola#hotmail.com
What happen in your case ?

Enter key not working on with in an html code for login

I am making a html page where you login to see links but I cant get the enter key working
<form name = "myform">
<p style="text-align:center">ENTER USERNAME <input type="text" name="username"></p>
<p style="text-align:center">ENTER PASSWORD <input type="password" name="pword"></p>
<p style="text-align:center"><input type="button" value="Check In" name="Submit" onclick= "validate()">
</p></center>
For your enter button to work, you need to change your button input type to submit.
<!DOCTYPE html>
<html>
<body>
<form action="action_page">
Username:<br>
<input type="text" name="username">
<br>
Password:<br>
<input type="password" name="pword">
<br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
I upvoted Darkhouse's answer but wanted to post this most simple version of your code that should also work just fine:
<form name = "myform">
<input type="text" name="username" placeholder="Enter Username">
<input type="password" name="pword" placeholder="Enter Password">
<input type="submit" value="Check In" name="Submit">
</form>

HTML Form to email issue. What is wrong with the line of code?

<input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />
Should I change "saveForm" to "Post"? Then where do I insert email address to send to?
yes you can do this with proper form
<form action="your page where you send the value"> <label>Name:
</label> <input type="text" name="name"> <label>Email:</label> <input
type="email" name="name"> <input type="submit" name="submit"> </form>
I cannot add the html form script here as this block does not allow me to. Can you view source at page at link: http://www.sparesite.co.za/index.html

Html code not working in Safari, but working in all other browsers

And I think it's not possible to submit the form in Safari browser
This is working fine in all browsers except safari
<form action="/commonDashboard" name="loginForm" method="post" autocomplete="off" id="loginForm">
<div>
<label>User Email ID</label>
<input type="text" placeholder="Enter your Email Address" id="userEmail" name="userEmail" tabindex="1" />
</div>
<div>
<label>Password</label>
<input type="password" placeholder="Enter your password" id="userPassword" name="userPassword" tabindex="2" />
</div>
<div>
<input type="button" value="Sign In" onclick="validatelogin();" tabindex="3" />
</div>
</form>
Change type="button" to type="submit"
Remove onclick="validatelogin();"
Assuming validatelogin is NOT performing any Ajax, change <form action="/commonDashboard" to
<form action="/commonDashboard" onsubmit="return validatelogin()" and have that function return true to allow submit or false to stop
or better add
window.onload=function() {
document.getElementById("loginForm").onsubmit=validatelogin;
}
In any case, please post the function so we can see what it does

how to expand the rows of an input field while keeping it part of the form

I know there quite a few people that say to get a multi-line input you need to use a textarea, but I can't because then it wouldn't be part of the form. Here is my code.
<form action="form.php" method="POST">
<input name="field1" type="text" value="type here" />
<input type="submit" name="submit" value="enter">
</form>
You can't. The only HTML form element that's designed to be multi-line is <textarea>
<form action="form.php" method="POST" id="myForm">
Name: <input type="text" name="usrname" />
<input type="submit" name="submit" value="enter">
</form>
<textarea name="comment" form="myForm"></textarea>
The texarea is outside the form, but by adding the ID of the <form> it's still a part of the form.
Is there a reason you can't use:
<form action="form.php" method="post">
<textarea name="field1"></textarea>
<input type="submit" name="submit" value="enter">
</form>