html button appearing as input box on form [closed] - php

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 8 years ago.
Improve this question
I Apologize for the simplicity of the question, still learning the ropes.
I have the following code:
<form action="backyard_funcs.php" method="post" id="register-form">
<input "type="submit" id="register-submit" name="register-submit" value="Create Account" />
</form>
My objective is to have a form that is submitted at the push of the button named register-submit. However it is not appearing as a button, instead it is appearing as an input box.
All help is appreciated. Thanks in advance.

This is wrong:
"type="submit"
it should be
type="submit"
otherwise you break parsing of that input and default type it then falls back to is text

Try using a code editor like
sublimetext : http://www.sublimetext.com/3
it'll help you color any coding errors later on so easily! :)
Here's the right code for your answer:
<form action="backyard_funcs.php" method="post" id="register-form">
<button type="submit id="register-submit" name="register-submit">Create Account</button>
</form>
Hope this helps!

<input "type="submit" id=....
should be
<input type="submit" id=....
without the quote before type

There is an ( " ) too much in your code
<form action="backyard_funcs.php" method="post" id="register-form">
<input type="submit" id="register-submit" name="register-submit" value="Create Account" />
</form>

Related

html form not using POST - acting funny [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 made bootstrap a form with this code and i am loosing my mind, not knowind why upon submitting is doing a GET method and redirecting to
tables.php?type=addTable&tablename=test&tablenumber=4#
And not to: essentials/settings-bar.php
<form action="essentials/settings-bar.php" method="post">
<input type="hidden" id="method" name="type" value="addTable">
<input
type="text" class="form-control col text-center m-1"
id="tablename" name="tablename"
placeholder="Table name"><br>
<input type="text"
class="form-control col text-center m-1" id="tablenumber"
name="tablenumber"
placeholder="Table number""><br>
<input type="submit" class="btn btn-primary m-2" value="Add table">
</form>
There was an unwanted hidden in the code, that i forgot about it

Sleep() doesn't delay on form action [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 4 years ago.
Improve this question
When I click on the submit button, I want a delay of 3 seconds and then a redirect.
My form will redirect to an other PHP site.
My code:
<button
class="button actionContinue scTrack:unifiedlogin-login-submit"
type="submit"
id="btnLogin"
name="btnLogin"
value="Login"
pa-marked="1">
Einloggen
</button>
</div></div>
<input type="hidden" name="" value="">
</form>
<?php
if (isset($_POST['submit']))
{
sleep(3);
// AND NOW action;
}
?>
Example
<?php
if (isset($_POST['submit']))
{
sleep(3);
// AND NOW action;
redirect('Location:next page.php');
}
?>
Why is it not working?
So the basic debugging in the comments shows that the $_POST['submit'] value which you expected to be there is actually not present. This is why your sleep is not working as the condition in your IF is not true.
So the next step is debug why you don't have that POST data. Which is because you don't have that as a form element. You will have btnLogin because that is the name you provided in your button.
name="btnLogin"
You can either test for the name you currently have:
isset($_POST['btnLogin']))
Or change the name in your button to Submit:
<button
class="button actionContinue scTrack:unifiedlogin-login-submit"
type="submit"
id="btnLogin"
name="Submit"
value="Login"
pa-marked="1">
Einloggen
</button>
EDIT: Try this as per your request in comments:
<?php
if (isset($_POST['btnLogin']))
{
sleep(3);
redirect('Location:next page.php');
}
?>

How to stop php from opening a new tab in browser when submitting a from [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 4 years ago.
Improve this question
I am new to php and I'm trying to have a form in which you have to input two numbers which are added to each other when submitted.
It works just fine, but whenever I click submit it opens a new tab in my browser (tested in chrome and firefox) to show to anwser, which I don't want.
I write the php code in the same file as my html.
Can anyone help me?
Thank you!
<!DOCTYPE html>
<form target="/index.php" method="GET">
<input type="number" name="num1">
<input type="number" name="num2">
<input type="submit">
</form>
<p>anwser:</p>
<?php
echo $_GET["num1"] + $_GET["num2"];
?>
php has nothing to do with new window or not...
its your target what does it... it opens a new window with internal name "/index.php"
what you are looking for is action="/index.php"
<form action="/index.php" method="GET">
<input type="number" name="num1">
<input type="number" name="num2">
<input type="submit">
</form>
<p>anwser:</p>
<?php
echo $_GET["num1"] + $_GET["num2"];
?>

Post and get method not show correct url [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 6 years ago.
Improve this question
<form action="../index.php?option=com_rsform&formId=3" method = "get">
<input type="hidden" name='form[Name]' value="1">
<input type="submit" value="Submit">
</form>
and i need this result:
http://localhost/index.php?option=com_rsform&formId=3&form[Name]=1
but i get this result:
http://localhost/index.php?form%5BName%5D=1
where is the problem?
This seems to be expected behavior regarding form actions when a combination of action URL parameters and form fields are present, and at the moment I'm not finding anything in a spec which tells otherwise.
The practical solution seems to be to just put the values you want in the form itself:
<form action="../index.php" method="get">
<input type="hidden" name='option' value="com_rsform">
<input type="hidden" name='formId' value="3">
<input type="hidden" name='form[Name]' value="1">
<input type="submit" value="Submit">
</form>
Check this: submitting a GET form with query string params and hidden params disappear
The GET parameters of "action" are overwrited by the form. So, the answer of David is correct.
Other solution: make a POST form and keep your URL ;)

Signup form: email and submit on the same [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 6 years ago.
Improve this question
At the bottom of my site, I have a sign up form. I can't make the button to be on the same line and close to that the email.
It already has a class assigned, so it's just about the css, but I'm no expert on css :(
Here is the HTML Code:
<div class="mc4wp-form-fields"><h1 align="center">
Want to hear updates on the future releases?
</h1><br>
<input type="email" name="EMAIL" placeholder="Your email address" class="signup" required="">
<input type="submit" value="Sign up" class="signup_button">
Any Idea how to do it???
Your input has a width of 100% - therefore taking 100% of the container.
input[type="email"] { width:/*something thats not 100%*/ }
You could float them, providing neither is set to 100% width...
<input style="float:left;" type="email" name="EMAIL" ....
<input style="float:right;" type="submit" value="Sign up" ....

Categories