Submit button in bootstrap not submitting the values - forms

<form name="form1" class="newsletter relative color_default button_in_input" action="process.php" method="post">
Hi trying to submit this form but its not doing anything at all. just stays there all the time.

You need to close the form and ensure that the submit button is within the <form></form> tags.

Related

Possibility of a Form without a Submit Button

hope You all have a great day.Here I'm trying to create a form without submit buttons,but when press enter on the text-box the whole text-box gonna hide.why is this is happening?,is it actually possible to create a form without a submit button or is that is a mandatory thing?,thanks for Your valuable time.
<form >
<input type="number" name="cbarcode" id="cbarcode" autofocus/>
</form>
When you hit 'enter' it submits the form.
I believe this is a natural part of a 'form' behavior for accessibility. Input inside of a form is meant to be data the user sends or inserts somewhere which is likely the reasoning behind this.
You can add to the Html form onsubmit="return false" or return preventDefault() as an event handler / function with other handling code you may want to provide.
Try this:
<form onsubmit="return false;">
<input type="number" name="cbarcode" id="cbarcode" autofocus/>
</form>

How to make fancybox close after hitting "submit button"

My form comes from Hubspot and is embedded into a fancybox.
I would like the box to close as soon as the person hits "submit" but instead it redirects and stays open.
Secondly, I tried entering the code to clear the content box after submission but the old data stays in the fields after reopening.
How do I make the box close after they "submit"?
How do I code so that fields clear after each submission?
http://online.saintleo.edu/FancyBox2/FancyBox.html
In advance, thank you. You guys/gals are great.
After inspecting your Fancybox I found this html:
<form accept-charset="UTF-8" enctype="multipart/form-data" id="hsForm_bc762bf8-087a41ec-8f55-263df96f988a" class="hs-custom-form stacked hs-form" action="https://forms.hubspot.com/uploads/form/v2/206683/bc762bf8-087a-41ec-8f55-263df96f988a" method="POST" novalidate="novalidate">
It works as expected when I add target="_top" to it.
Your form.html may have a form tag. Add target="_top" to it.
See this link Link here
Add target="_top" in form tag
<form target="_top">

Stopping a barcode scanner refreshing page

I am using a barcode scanner in an HTML form and have a problem with the page refreshing
The scanner's input goes into this form (html 5):
<form>
<label for "bar_code">Item</label>
<input
name="bar_code"
id="bar_code"
onchange = "processBarCode('getitemdetails.php', this.value);"
onfocus="setStyle(this.id);"
autofocus
>
</form>
The processBarCode is a AJAX function that checks if the barcode is in a mySQL database and if it is adds the item to a <form> further down the page, this works perfectly. The problem is that because the bar code scanner adds an enter to the end of the scan when the function returns it triggers a submit thus causing the page to refresh.
I need the added enter for the onchange to work automatically but still need to disable the page refresh.
Any ideas gratefully received!!
Change your form element to cancel the submit:
<form onsubmit="return false;">

How do I keep track of when what is the text entered in the form when the user navigates away from the page?

I have a piece of code like this.
<form method="get" action="{$self}" name="addcommentform">
<textarea title="{$enterComment}" name="comment" class="commentarea" </textarea>
<input class="Button" type="submit" value="{$postComment}" />
</form>
How do I keep track of when what is the text entered in the form's textarea when the user navigates away from the page? I want to prompt the user with a warning message so he/she doesn't lose the text.
Thanks.
You could use the javascript/jquery blur event, and if the user hasn't clicked the desired button have it display the form values. This might help JQuery Blur Validation Problem
Stu
Take a look at this Javascript code snippet:
http://www.boutell.com/newfaq/creating/disableclose.html
This takes advantage of the window's onbeforeunload event which fires when the user is about to leave the page.

Form submit and Ajax call

I am having a problem when submitting a form.
Here is the situation
<form ....>
<input type="text" id="ajax"> <img onclick="saveTextBox">
<input type="text">
<input type="text">
<input type="text">
</form>
In the above form when the img is click on I call an Ajax script to save the button.
That's OK.
What I need is when I am focus on textbox Ajax call ajaxscript (without click img).
I add an jQuery to manage key=13 and call the script BUT the problem is that run the Ajax script AND submits the form too.
How can I override the form sumit when I am focus on Ajax text box and hit enter key?
First. Scrap the image and replace it with a real submit button.
Then. Handle all the JS interaction in the onsubmit event for the form element. Cancel the default action, so that the JS runs and the normal form submission doesn't (when JS is available).
In short: be pragmatic, build on something that works, and intercept events at the right moment. Don't ignore the primary purpose of an element and create an entirely new way to trigger something it does already.
Return false.
Sample event function that will stop the submit event:
function submitHandler() {
// do ajax stuff here
return false;
}