for some reason my mail to function does not seem to work in android devices.... i'm really confused what to do as it seems to be working fine on windows devices
<article class="contact_form">
<h2><i>Reach Me</i></h2>
<table class="contact-table">
<form action="mailto:sanwal.sahil#yahoo.com" method="post" enctype="multipart/form-data" name="EmailTestForm">
<tr>
<td><label for="name">Name:</label></td>
<td>
<input type="text" id="name" name="visitor" />
<br>
<br>
</td>
</tr>
<tr>
<td colspan="2">
<button type="submit" colspan="1" class="form-submit">SUBMIT</button>
</td>
</tr>
</form>
</table>
</article>
mailto:, in general, has very unreliable support as a form action. This is likely just one more example of that. You should avoid it entirely in favour of using an HTTPS (or even HTTP) URL with a server side form handler.
Additionally, your form is invalid in a way that will break it in a number of browsers. Write valid HTML.
Related
I am playing with the Spring validating form input example - java spring mvc with Thymeleaf views. I have been able to pass messages into the view without issue. These display where the example wants them to...
e.g.
<td th:if="${#fields.hasErrors('name')}" th:errors="*{name}">Name Error</td>
I am trying to find a way to put them into the html input validation attributes though so I have tried the following (full page below)
<td><input type="text" th:field="*{age}" **required="required" data-errormessage-value-missing="${#fields.errors('age')}" data-errormessage="${#fields.errors('age')}"**/></td>
This has done no good though and the validation message displayed is ${#fields.errors('age')} ! Is there a way to push the binding errors into the attribute or am I misunderstanding the way it works ?
Thanks for any help in advance.
Page html
<html>
<body>
<form action="#" th:action="#{/}" th:object="${personForm}" method="post">
<table>
<tr>
<td>Name:</td>
<td><input type="text" th:field="*{name}" required="required" data-errormessage-value-missing="Custom Message" /></td>
<td th:if="${#fields.hasErrors('name')}" th:errors="*{name}">Name Error</td>
</tr>
<tr>
<td>Age:</td>
<td><input type="text" th:field="*{age}" required="required" data-errormessage-value-missing="${#fields.errors('age')}" data-errormessage="${#fields.errors('age')}"/></td>
<td th:if="${#fields.hasErrors('age')}" th:errors="*{age}">Age Error</td>
</tr>
<tr>
<td><button type="submit">Submit</button></td>
</tr>
</table>
</form>
</body>
</html>
Thymeleaf only evaluates attributes that start with th:, so in order to do this, you have to use th:attr. You're tag should look like:
<input type="text" th:field="*{age}" required="required" th:attr="data-errormessage-value-missing=${#fields.errors('age')}, data-errormessage=${#fields.errors('age')}" />
You could also use this plugin to evaluate data tags, but I've haven't used it before so I can't comment on how well it works: https://github.com/mxab/thymeleaf-extras-data-attribute
Hi I have a fairly simple HTML login form:
<form name="login" action="checklogin.php" method="post">
<table>
<tr>
<td>Login to Continue</td>
</tr>
<tr>
<td>Username</td>
<td><input name="username" type="text" value=""></td>
</tr>
<tr>
<td>Password</td>
<td><input name="password" type="password" value=""></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Login"></td>
</tr>
</table>
</td>
</form>
This works fine in Google Chrome but when it comes to IE10 on Windows 7 the form auto completes and submits. I have checked the obvious auto complete options in IE10 and ensured they are off and all stored information is cleared. However the form still gets auto completed and submitted. Is there some way of explicitly instructing IE10 not to do this?
Ok got it. This is an HP machine and it was running HP Simple Pass. This installs a BHO Add-in to IE 9+ called "True Suite Website Logon" which was responsible for this behaviour. Thanks for the help.
When i run the following code below it works in dreamweaver but when i go to view it in a web broswer nothin shows.
The code is
<table cellpadding="5" cellspacing="1">
<tr>
<td align="center">
<form action="search.php" method="get">
<table><tr><td>
<input type="text" name="query" id="query" size="40" value="<? print quote_replace($query);?>" action="include/js_suggest/suggest.php" columns="2" autocomplete="off" delay="1500">
</div>
<td>
<input type="submit" value="Search!">
</td></tr></table>
When i go to view the source code in chrome it only loads
<table cellpadding="5" cellspacing="1">
<tr>
<td align="center">
<form action="search.php" method="get">
<table><tr><td>
Check with your host to see if they've enabled the <? tag. It's not turned on by default. If it's not, it's probably causing Chrome a lot of grief.
Check out your syntax. What you've pasted isn't valid. It looks like your'e closing your form twice, or you have an extra set of quotes in the "get" area.
On a side note, I suggest removing display related HTML attributes in favor of CSS. It will help keep a clear distinction between function and look.
I've come across a weird problem. I have a simple form which submits data to a php processor page. However, the following input to the description field causes a 404 Error.
To recognize and reward the best in
Indian theatre, The Mahindra and
Mahindra presents META (Mahindra
Excellence in Theatre Awards). The
only award of its kind, META is
designed to showcase the best in
theatre being produced in India. An
eminent selection committee shortlists
the 10 best plays from innumerable
entries from all across India. These
plays are staged and adjudged under 13
award categories. The festival
culminates with an scintillating
awards ceremnony. Entering its sixth
year, META’s objective remains to
encourage all aspects of theatre craft
such as playwriting, set, costume and
light design, direction and
performance and promoting theatre.
I've tried changing the apostrophes and commas, even the brackets, but it didn't help.
The code for the form:
<form class="cms" action="add.php" enctype="multipart/form-data" method="post">
<table>
<tr>
<td class="text">
Title
</td>
<td class="input">
<input type="text" size="20" name="title" value="" />
</td>
</tr>
<tr>
<td class="text">
Date
</td>
<td class="input">
<input type="text" size="20" name="date" value="" />
</td>
</tr>
<tr>
<td class="text">
Image
</td>
<td class="input">
<input type="file" name="image" />
</td>
</tr>
<tr>
<td class="text">
Description
</td>
<td class="input">
<textarea name="description" rows="5" cols="20"></textarea>
</td>
</tr>
<tr>
<td class="text">
Link
</td>
<td class="input">
<input type="text" size="20" name="link" value="" />
</td>
</tr>
<tr>
<td class="text">
<input type="submit" value="Add / Save" />
</td>
<td>
<input type="reset" value="Clear" />
</td class="input">
</tr>
</table>
</form>
On submitting the text above i get the following error :
Not Found The requested URL
/cms/events/add.php was not found on
this server.
Apache/1.3.41 Server at
www.xyzs.in Port 80
Is this a problem with the text-encoding?
Could the add.php page contain an execute, maybe for an error page if the input is to long and the 404 is because the error page is not there?
I have seen similar errors in ASP where execute "" was used to load another page and if that page was not found you got an error, but exactly which error can differ from server implementation.
Also, does this work with other input with shorter or same length?
For someone else with Similar Issue:
Your text contains sensitive keywords which cause 404. Last night I got similar issue with text area, After deep analyzing I found that my text contains a keyword "Select", When I remove it submits successfully. In your case keyword "META" might causing this error.
What you have to do is white list these sensitive keywords from your server by contacting your server administrator.
I read several articles, but couldn't really get things working. Here's what I'm talking about. The Html of a webpage:
<form id="LOGINFORM" name="LOGINFORM" style="margin:0px; padding:0px;" action="login.php" method="post">
<table cellspacing="2" cellpadding="0" border="0" width="100%">
<tr>
<td width="100" align="center" valign="bottom">
Username:
</td>
<td width="100" align="center" valign="bottom">
Pass:
</td>
<td valign="top" align="right">
</td>
</tr>
<tr>
<td align="center">
<input class="inputbox" style="text-align:center; width:90px;" maxlength="12" name="loginname" type="text" size="12">
</td>
<td align="center">
<input class="inputbox" style="text-align:center; width:90px;" maxlength="12" name="password" type="password" size="12">
</td>
<td align="left">
<input
class="button_ok"
name="btnSubmit"
id="btnSubmit"
type="submit"
value="Вход"
onclick=""
>
</td>
</tr>
</table>
</form>
say the webpage is helloworld.com, account is foo, pass is bar.
What I browse: helloworld.com/login.php?loginname=foo&password=bar
But server returns that username/password is wrong, but they aren't. What do I do wrong?
The logic in login.php says that loginname=foo&password=bar is wrong. That is where you need to look to find out why it doesn't work.
As for what is wrong with the HTML.
You are using a table for layout
You aren't using <label> elements to label your inputs
You having given a form a name, these days an id is all that is required (and then only if you need to reference it with JS or CSS)
You are using a style attribute instead of a seperate stylesheet, and quite a few obsolete presentational attributes (such as align, width and cellspacing)
that form secifies that the data is passed via POSt, and not GET as you are trying to pass it. If a form wants data back specifically as POST data, that page will ignore GET data. see this tutorial
Your HTML says method="post", so I guess the server will only accept those values by the POST method. When you browse that URL, you are sending them using the GET method.
You are confusing GET and POST in PHP:
$_GET['loginname'] will retrieve a query string variable.
$_POST['loginname'] will retrieve the value of the input named "loginname". (This is what you need.)
helloworld.com/login.php?loginname=foo&password=bar uses GET