HTML Form Resets on Submit - forms

I've a website used by over 500,000 people, but a tiny few (about 20) are reporting that one of the forms resets when clicking "submit".
I've stripped out other code, but the HTML in the FORM tags is complete:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<body>
<form id="fProfile" action="/cv.html" method="post" enctype="multipart/form-data">
<div class="row"><label for="fName">Your Name:</label><input type="text" id="fName" name="text" /></div>
<div class="row"><label for="fEmail">Your Email:</label><input type="text" id="fEmail" name="email" /></div>
<div class="row"><label for="fCvFile">Your CV:</label><input type="file" id="fCvFile" name="cv" /><em>Please only attach a CV, up to 200kb in size.</em></div>
<input type="submit" class="submit" name="go" value="Save CV" />
</form>
</body>
</html>
There is no JavaScript involved and the form could not be simpler!
Feedback is limited, but it's being reported that this happens on MSIE/Chrome/Firefox. It must be third party software interupting the form but reports come in from computers with McAfee/AVG/Avast. I can't find a single common factor other than the HTML ...
All reports say that the form resets on clicking the submit "Save CV" button without attempting to load a page but I'm unable to replicate this.
I've never come across anything like this and am hoping one of you have!
Thanks for any help or guidance.
EDIT: I've added a name/email input form too to show that it is just the type=file input that is resetting. The remainder of the form holds on to the entered text.

It says you are posting to a HTML page - surely you would need to post to a PhP page or similar.
So basically when you hit submit the page is just refreshing. Also in your HTML page you should always have a head tag.

Related

AMP email with form and server protect of action-xhr

I'm planning to use an AMP email with an embedded form to collect some data using an action-xhr action, I will develop a new service in my back end to collect this information, but I have a trivial question about how I can protect my service to avoid bot and more in general malicious calls.
In my original idea, I planned to use the reCAPTCHA v3 AMP component, but this is available only for the AMP websites, so I can't use it in the AMP email.
So, if I understand correctly, there isn't a way to protect my service from the bot, and the idea of exposing a service without any form of protection doesn't like me.
Another option is to avoid a multi-call from the same IP, but this is not a real solution.
Let for examle the AMP email:
<!doctype html>
<html ⚡4email data-css-strict>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
</head>
<body>
<form method="POST" action-xhr="https://rest.service.com">
<fieldset>
<label>
<span>Phone number:</span>
<input type="text" name="phoneNumber" required>
</label>
<input type="submit" value="Subscribe">
</fieldset>
<div submit-success><template type="amp-mustache">Subscription successful!</template></div>
<div submit-error><template type="amp-mustache">Subscription failed!</template></div>
</form>
</body>
</html>
How can I protect the https://rest.service.com REST service, I don't find any specific response to this need, do you have suggestions or best practices?
Thanks

To send Form data to the same page using classic ASP

I want to send Form data to the same page using classic ASP.
Code:
<%#LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test Form</title>
</head>
<body>
<%
'Classic ASP:
Dim test
test = request.form("CtrlTest")
response.write "result = '" & test & "'<br>"
%>
<!-- alternative: <Form name="test" method="POST" target="_self" > -->
<Form name="test" method="POST" action="" >
<a href>ClickThis</a>
<input type="hidden" name="CtrlTest" value="ATest" />
</Form>
</body>
</html>
After clicking I had expected the result to be:
"result='ATest'
ClickThis"
But it is:
"result=' '
ClickThis"
How can I read the posted data?
Tested in localhost mode:
Chrome OK,
IE11: Error 403.14.
This makes me wonder how the POSTing happens:
The POST data is sent to a server that passes the data on to the target Receiving ASP or PHP page.
When the Receiving page opens first time after the transmission the data is available for request.
If the Receiving page is the same as the Sending page (e.g. target =”_self”) the data is immediately available in the page (if it is an ASP or PHP page).
The next time the Receiving page opens the data is no longer available.
Is this correct?
And this should work OK even if I am in localhost mode, and not reaching an actual server?
If the Request lines in the Receiving page lies in a file that is #included into the Receiving file – will it still work?
Links do not submit forms. They just go to the URL in the href attribute.
To submit a form, use a submit button.
<button>Submit</button>

MaskEditExtender Ajax toolkit- not able to copy paste IE 11

I have two date textboxes in my ASP.Net application and these textboxes are using MaskEditExtender so that only date can be entered in them. These textboxes are actually from and to textboxes to enter a date range.
The issue is that in IE 11 the user is not able to copy-paste date from one text box to other using Ctrl+C and Ctrl+V.
The user is able to paste the date by right clicking and selecting copy paste but in this also the date does not get properly formatted in the second textbox. In IE8 and lower browsers it worked fine.
Sample code used:-
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TextBox1"
Mask="99/99/9999" MaskType="Date" ClipboardEnabled="true"/>
<ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TextBox2"
Mask="99/99/9999" MaskType="Date" ClipboardEnabled="true"/>
</div>
</form>
</body>
</html>
Please suggest.
Yes, there is a bug that was fixed recently, but this fix is not published at the moment.
You can see changes here or wait for new ACT release.

post form to an iframe on another form (is it possible)

I'm using ASP.NET web forms and i need to post data to an iframe, the problem is that in web forms I have the main form tag(form1), so i need another form tag(form2), to post data to the iframe that is in the main form1.
Basically i have this:
<form method="post" id="form2" action="http://localhost:58903/WebForm1.aspx" target="webApp">
<input type="hidden" name="ValidationUserName" value="david" />
<input type="hidden" name="ValidationTokenId" value="13123132132" />
<button type="submit">Send info to inner iframe</button>
</form>
<form id="form1" runat="server">
<iframe id="webApp" name="webApp" src="http://localhost:58903/WebForm1.aspx" style="width: 800px; height: 800px;"></iframe>
</form>
With this approach in open a new tab, if i put the iframe outside it works ok, but if i do this the layout is changed and i don't want this.
Is this possible?
If all the forms are in the same domain you should not work with iframes.
What exactly are you trying to get here? didn't realize completely
Done it, it was missing the "name" attribute in the <form> tags.

Problems with Coldfusion Form Submissions

I'm having a bit of trouble with my form submission, and I'm afraid I need some advice.
I have a form where I want a user to submit some text, and when they press submit it will take them to an action page where the input will be processed. I wrote some code, only to figure out when I test it in Dreamweaver the submit button isn't working correctly.
Code looks like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head>
<title>Test Page</title>
</head>
<cfinclude template="head.cfm">
<cfform name="select_action" action="testaction.cfm" method="post">
Enter some text here
<input type="text" size="50" value="Enter some text here" maxlength="150" name="someText"><br>
<INPUT TYPE="RESET" NAME="reset" VALUE="Reset Form">
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Submit Form">
</cfform>
<cfinclude template="foot.cfm">
I have Dreamweaver correctly configured for testing, because I can reset the form and it shows up properly etc. Just the submit button doesn't take me to anywhere.
I feel that there's something extremely obvious I'm missing, any advice?
Thanks for your time,
Jordan
While testing in Dreamweaver may seem like a good idea, I haven't found it helpful at all. You should have your page open in several browsers at once, such as Firefox and Chrome. Test the behavior of your pages in real browsers, not Dreamweaver.
Also, I would use CFFORM only if you need CFFORM. From the looks of your elements, you don't need it.