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 days ago.
Improve this question
So im changing the form of a custom build zipcode based products plug-in, the form used to work but stopped working even though I made no changes to the code.
In the console log it display this error but im not sure how to fix this cause nothing has changed.
Console log Error
Where the error displays
function show_form() {
$form = '<div id="zipcode_overlay">
<div id="zipcode_form_container" style="max-width: 1400px;">
<form id="user_zipcode_form" method="POST">
<h4 id="zipcode_form_header">Geef a.u.b. uw <span class="reviews">postcode</span> op</h4>
<label id="user_zipcode_label" for="user_zipcode">Vul hier de postcode van het plaatsingsadres in en zie direct alle informatie en scherpe prijzen van de containers die in uw postcodegebied leverbaar zijn</label>
<input type="text" name="user_zipcode" id="user_zipcode" value="" placeholder="1111AN" onchange="handle_change()"/>
<input type="button" id="zipcode_form_btn" value="Verzenden" onClick="submit_form()" />
</form>
</div>
</div>';
return $form;
}
Let me know if you can help me!
I tried handle_change(this) and handle_change(this.handle_change).
Related
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 8 months ago.
Improve this question
I am trying to make a registration page for my website but when I run it; it gives error. What am I doing wrong?
<?php
//Form values
$name_value=$_POST['Name_input'];
$Username_value=$_POST['Username_input'];
$DOB_value=$_POST['DOB_input'];
$Password_value=$_POST['Password_input'];
$Phone_number_value=$_POST['Phone_number_input'];
$Python_checkbox_value=$_POST['Python_checkbox'];
$Java_checkbox_value=$_POST['Java_checkbox'];
$C_sharp_checkbox_value=$_POST['C#_checkbox'];
$HTML_checkbox_value=$_POST['HTML_checkbox'];
$Cpp_checkbox_value=$_POST['C++_checkbox'];
$R_checkbox_value=$_POST['R_checkbox'];
$swift_checkbox_value=$_POST['swift_checkbox'];
$kotlin_checkbox_value=$_POST['kotlin_checkbox'];
$JS_checkbox_value=$_POST['JS_checkbox'];
Take a look at this code :
<form method="GET">
<input type="checkbox" value="value" name="name">checkbox label</input>
<input type="submit">
</form>
<?php
if (isset($_GET["name"]))
{
echo $_GET["name"];
}
?>
As you can see when I submit the form without checking, the parameter in URI is empty because the checkbox isn't defined (I used GET method)
But when I check it, you can see the parameter is name=value
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 1 year ago.
Improve this question
I am trying to create a html form with required input fields. but its not responding. below is the code
<div class="col-sm-6">
<label for="city" class="form-control">city
<input name="city" type="text" id="city" class="form-control" required>
</label>
<div class="invalid-feedback">
valid city is required
</div>
</div>
If by "not responding" you mean that a user can submit the form without entering a "City" value, it may be because you need a <form> element around form controls in order to allow browsers' default behavior for required inputs to work correctly.
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
Thanks for those who helped! I have figured it out!
How can I create a input field like the one in the image? And I want to embed it inside $_POST. Thanks for your time :)
This is an HTML5 input of type number. You use it this way:
<form method="POST" action="yourPHPfile.php">
<input type="number" name="number_input">
<input type="submit">
</form>
When this form is submitted, it will send the selected number to yourPHPfile.php and you can retrieve the number from $_POST['number_input']
You can use input for the number selecotr and post using a form like so:
<form method="post">
<input type="number" name="intNumber"/>
<input type="submit" />
</form>
Then in PHP you can do this
<?PHP
if(isset($_POST['intNumber'])){
$myNumber = $_POST['intNumber']; // intNumber is the name of of your input
}
?>
When the submit button the PHP will be fired.
Hope this helps!
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 years ago.
Improve this question
I need some help with my php code
<?php
date_default_timezone_set('America/Los_Angeles');
$now = date("H:i:s");
?>
<form method="post" name="update" action="update.php" />
<input type='text' name='fname' value=''>
<input type='text' name='lname' value=''>
<input type='text' name='email' value=''>
...
<button type="submit" value="Submit"/> Submit </button>
</form>
What i need:
If someone clicks on button submit but it passed less than 1 min since start($now)
then it must appear an Alert "Check Info"(not another page or popup),
an alert like "Do you really want to leave the page?"
I should not work for free... but I won't give you the full answer!!! Make an effort and fill in the right code <<< FILL >>> to get it to work!!!
<script src="<<<FILL>>>"></script>
<script>
submitAllowed = false
$("form").submit(function(e){
e.preventDefault();
if (<<<FILL>>>||confirm("Do you really want to leave")) {
this.submit()
}
});
function submitAttempt(){
submitAllowed = true;
}
setTimeout(<<<FILL>>>, 60000);
</script>
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 have a simple html page which should take the input from text box and send that as an email.
function getData()
{ var txt=document.getElementById("result").value; }
<body>
<form>
<input type="text" id="result" size="20">
<input type="button" onclick="getData()">
</form>
</body>
Now i need to send the value of txt as email. Whats the easiest way to achieve that? I am familiar with Java/ Java script. I have no hands on PHP.
You cannot send an email using client-side JavaScript.
You will need to submit the form to a server side script which can send the mail for you.
This is not too difficult using PHP, so I urge you to read up on it. Here's a good link: http://code.tutsplus.com/tutorials/sanitize-and-validate-data-with-php-filters--net-2595
<form action="myscript.php">
<input type="text" name="message" size="20">
<input type="submit" value="Send mail"">
</form>
Then in myscript.php:
<?
$message = filter_var($_POST['message'], FILTER_SANITIZE_STRING);
mail("someone#example.com","My subject",$message);
?>