Submit Button not working - could be broken code? - html

Need help to get my form working. I am creating it for a website as a small school project.
Below is the code to the submit button. Am I missing something? (I can place the whole code if needed):
<form>
<!-- END_ITEMS -->
<input type="hidden" name="EParam" value="FzpUCZwnDno=" />
<div class="outside_container">
<input type="button" onclick="Vromansys.FormBuilder.showPreview()" value="Submit Form" class="submit_button" id="FSsubmit" />
</div>
</form>

Did you try input type="submit" ... instead of "button"? It should work with "submit" when using "form".
Best regards,
Dino

Related

HTML button to direct to PayPal Gving Fund not working

Can someone tell me why this codes will not link to the page?
<form><input class=”MyButton” type=”button” value=”PayPal Giving Fund” onclick=”window.location.href=’paypal.com/us/fundraiser/charity/1521457//button- links.php'” /></form>
I have also tried
<form><input class="MyButton" type="button" value="PayPal Giving Fund" onclick="window.location.href='htpps://www.paypal.com/us/fundraiser/charity/1521457/button-links.php'" /></form>
Neither work. Says page cannot be found.
try this
you had a typo in 'htpps' also use the action param of the form instead of a onclick, it's mean to do that
<form action='https://www.paypal.com/us/fundraiser/charity/1521457/button-links.php'>
<input class="MyButton" type="submit" value="PayPal Giving Fund">
</form>

Href link on input button submit

How can i bind this link
<a href="edit?id=<c:out value='${person.id}' />">
to input button "submit" ?
try something like that. Hope this will fix your problem
href="\edit?id={{person.id}}"
Typically if you are using a submit button, then you will be inside a form. An example of this would be:
<form action="edit?id=<c:out value='${person.id}' />" method="post">
<!-- form fields here -->
<input type="submit" value="Submit" />
</form>
In this case, the submit button is "tied" to the form, and will post the form data to the link in the action value.
I found solution :
<input type="hidden" name="from" value="${param.from}">
Servlet.class
response.sendRedirect(request.getParameter("from"));

Navigation from a HTML file into another

I have 2 html files in my desktop(login.html & firstpage.html). I have a button in login.html. when i pressed that button i need to navigate to firstpage.html screen.
I have tried like below; I wrote this in login.html page, But it's not working,
<form name="myform">
<input type="button" value="Enter" width="100px" onclick="<a href ='C:\Users\Desktop\firstpage.html'</a>">
</form>
Could anyone please help me to solve this issue.Thanks
Change the code in
<form name="myform" action="firstpage.html">
<input type="submit" value="Enter" width="100px">
</form>
To just link the two files, all you need is to have them in the same folder, and use this line:
<input type="button" value="Enter" width="100px" onclick="document.location='firstpage.html'">
You do not need a form to do this.
Your onclick handler does not need html in it, just the javascript.
You could also do:
Go to page
Make Slight changes in your code like this
</input>
This should work... :)

Form is not appearing but its content does

I have this piece of code:
<div>
<form name='profileForm' id='profileForm' action='' method='get'>
<input type='submit' name='ProfileBtn' id='ProfileBtn' class='buttonC' value='My Profile' />
</form>
<br />
<form name='logoutForm' id='logoutForm' action='' method='get'>
<input type='submit' name='LogOutBtn' id='LogOutBtn' class='buttonC' value='Logout' />
</form>
</div>
When I render the above the "profileForm" does not appear (although the profileBtn DOES appear).
the seconed form has no problems, which is weird because they are both similar.
It's probably an easy question but I have no idea what's the problem.
This just happened to me using Chrome -- it was because I had a form within a form. It looks like Chrome just stripped out the <form> open and close tag because my form was within another form. When I moved one form outside of the other, then both <form> tags were rendered in the html as intended.
Crackermann was getting at this in his answer too.
It's hard to give a direct solution without seeing your full html, but I'm guessing this is your problem - you need to make sure your form is not within another form. Really simple example to illustrate this:
Form within another form, notice if you run this code in Chrome and inspect <form id="form2"> is not rendered:
<html>
<head></head>
<body>
<form id="form1">
<div>form within a form</div>
<form id="form2">
<input type="text" placeholder="name" /><br/>
<input type="text" placeholder="title" />
</form>
</form>
</body>
</html>
If you move form2 outside of form1, run the code in Chrome and inspect, then <form id="form2"> is rendered:
<html>
<head></head>
<body>
<form id="form1">
<div>form2 moved outside of form1</div>
</form>
<form id="form2">
<input type="text" placeholder="name" /><br/>
<input type="text" placeholder="title" />
</form>
</body>
</html>
well then somehow there was a weird problem with the forms, the button didn't show up because when i ran the website the the 'profileForm' just disappeared somehow (and didn't show up in the console).
what i did was adding a third Form before 'profileForm' which somehow solved this.
There is an unclosed HTML TAG like < form > in your code before these lines ,
Find and close that form
OR
just put </form> before your code.
Just put a empty form on top of your form.
Then all forms will be appear with form id
<form></form>
<form name='profileForm' id='profileForm' action='' method='get'>
<input type='submit' name='ProfileBtn' id='ProfileBtn' class='buttonC' value='My Profile' />
</form>
<form name='logoutForm' id='logoutForm' action='' method='get'>
<input type='submit' name='LogOutBtn' id='LogOutBtn' class='buttonC' value='Logout' />
</form>
Check that you don't an unclosed form element before your next form open.
If you do, browsers will generate the source without displaying the subsequent form open and form close pair.
Try viewing your Page Source
For Mac users
Option + Command + U
For Windows users
Ctrl + U
Then check for any unclosed <form> tag above your specified <form> tag and close it.
It works for me, hope it works for you too

how use button in internet explorer?

on my source i use
<a href='pag.php'><input type='button' value='Next'/></a>
in firefox and crome when i click on the button i'm redirected to pag.php
but in ie it don't work. how can i do?
The simple way is:
<input type='button' value='Next' onclick="location.href='pag.php'"/>
Form buttons are meant to be used for submitting a form to the page specified in the action attribute, not to be wrapped in <a> tags, which is bad syntax. If this is for a multi-part form, simply add the action attribute to the <form> tag like
<form method="POST" action="pag.php">
<!-- your form elements -->
<input type="submit" value="Next">
</form>
And that will submit the form to pag.php. Otherwise, just use a link, or, if you insist on having it look like a button, use an image link like:
<img src="image_that_looks_like_a_button.png">
Hope this helps.
Instead of what you are doing right now, go for:
<form action="pag.php" method="post" enctype="multipart/form-data">
<INPUT TYPE="submit" name="Submit" value="Next">
</form>
But if you want image instead in place of button, go for:
<INPUT TYPE="image" SRC="image location" ALT="Next">
Hope it solves your problem! :)