html-form

Am I using onchange incorrectly?

I'm trying to have a value (key) that updates to correspond with a number in a textbox (angle) divided by a value (25). However, for some reason, the changeMe function doesn't seem to be executing. Am I using onchange incorrectly? <script type="text/javascript"> function changeMe(x) { var y=document.getElementById(x).value; y = (y/25);...

Pressing enter inside a textbox does not fire onclick event of submit button in firefox

I have this html page which is very simple, it contains a text box and a submit button, what I want is when typing something in the text box and pressing enter the function in the onclick event of the button gets called. It's working in IE and Google Chrome but not working in FireFox, is this a normal behavior of FireFox or there's somet...

HTML Encoding Form Post

A user has sent me some information that they posted to one of my pages with potential XSS issues however, looking at the server side code I don't think it would ever run through my code smoothly. They said they sent this: forminfo=%27+%7C%7C+%27%27+%7C%7C+%27%25booleantest%3Atrue%2Ctrue%2Ctrue I have looked at this and have worked o...

Best practices for storing html form content in XML document

I have two web forms which are filled in by the user. They contain different types of fields: text boxes, radio buttons, check boxes (single or in groups). All the information that user submits I store in XML field in a database. My question is: what are the good practices for string that kind of informations in a XML file. For now I...

Good solution to the 'preventing default button on form from firing' problem?

I need a solution for the age old problem of a 'default button' firing undesirably. i.e you hit enter in a text box, but there is a submit button on the form that isn't the one you want to fire (or maybe you don't want the form to fire at all). I'm wondering about the following 'solution'. Slightly hacky but should be reliable as far as...

Multipart/form-data and UTF-8 in a ASP Classic application

Hi all, I have a problem that I really don't understand. I'm trying to upload a files in a asp classic app, without the use of an external component. I also want to post some text that will be stored in a DB. The file upload perfectly, I'm using this code: Upload Files Without COM v3 by Lewis E. Moten III The problem is the other form...

Why do the major browsers not support HTMLs ACCEPT attribute for input type="file"?

Does anyone know how to use the accept attribute in input tags? I can see it documented, but w3schools indicates that it is not supported by any of the major browsers. Testing also confirms this. I know that validation should be done server-side, and am doing that now. But it'd be nice to have it restrict the types of files in the file ...

How Do I Prevent Enter Key Submit in jQuery?

I'd like to either simply swallow an Enter key press in <input> fields or else instead substitute Tab key presses. I haven't yet decided which is best. How can I do this in jQuery? I've got this so far: $(document).ready(function(){ ... //handle enter key $("input").keypress(function (e) { var k = e.keyCode || e.w...

ASP page not receiving POST parameters

Hi all, I am writing a small application in Classic ASP. I have a page which has a form, which posts to a second page. Included with the form's POST, are file uploads, hence the need for a POST method. The second page though is NOT seeing ANY of the fields being sent by the first page. Calling either Request("param") or Request.Form("...

Search Results and the Back Button / HTML Forms

I'm looking for a solution to a recurring problem I have with form based search results in my application. Basically when a user searches using an HTML form and I display the results from the Database on the next page, this works perfectly. However, when a user clicks on an individual record in the result set and then clicks "Back" on ...

ASP Button (Command vs Submit)

I want this to be a command button not a submit button, so that when the user presses the "Submit" button is "clicked". ASP Code: <asp:Button CommandName="StartButtonName" CommandArgument="soo" CausesValidation="false" ID="StartButton" Text="..." Visible="false" runat="server" OnClick="StartButton_Click" /> Generated HTML co...

Can you change the action of a form without JavaScript?

Hey everyone, I was hoping to do the whole degrading gracefully thing without making my form have ugly extra buttons and breaking up my program structure with another layer of indirection. I really doubt that this is possible, but is there an option I am unaware of? Thanks! ...

Generating URL through routing, using ID from a form field (ASP.NET MVC)

Say I want to display user details like so: http://www.mysite.com/user/1 I set a route up like so: routes.MapRoute("UserDetails", "user/"{id}", new { controller = "User", action = "Details" }); Then my controller: public ActionResult Details(int id) { User currentUser = _userRepository.GetUser(id); if (currentUser == nul...

Get form data with Javascript/Jquery

Is there a simple, one-command way to get the data of a form as it would be if it was to be submitted in the classic HTML-only way? For example, in: <form> <input type="radio" name="foo" value="1" checked="checked" /> <input type="radio" name="foo" value="0" /> <input name="bar" value="xxx" /> <select name="this"> <option value="...

Cannot click or select inputs on IE 8 Form.

So basically been working on this issue for far too long now and nothing I do seems to fix the issue. Basically if you go to http://www.completeenergy.co.uk and click on the "Get a Quote" button then try to enter details into the form nothing happens. You can not click on the inputs and or select anything within the form. This seems to...

Is there any Javascript library that provides drag'n'drop creation/editing of form elements?

I am writing a web application that lets a user create their own forms by dragging and dropping input elements (textfields, textareas, etc.). Currently, the user is able to add / reorder (up or down) / remove form elements, but I need to make them freely draggable. Some time ago I have seen a tool written in Javascript that lets a user...

Calculate order price by date selection value

Alright, I know there's a simple way to do this, but it's been years since I've done much javascript My client has an online order form for event registration (developed by previous web dev.). Currently the order total is just a hidden field: <INPUT value=78.00 type=hidden name=amount /> But I need the total to calculate based on wha...

Validate form with Javascript using onsubmit

I have a website with an existing form, that submits an email address to a thirdparty website (foo.com). Now I'd like to validate the email input-field before submitting the form by using Javascript. My Javascript function isValidEmailAddress(emailAddress) { var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+...

Form with dynamic number of items

Hello, Just thinking about the best way to build an Order form that would (from user-perspective): Allow adding multiple items. Each item has Name, Job Type drop-down and File upload. User can add or remove items. User must provide at least one item. All the items should be validated (eg: Name, JobType and File are required). When he ...

ASP.net post and default page.

Scenario: I have a regular aspx page with a form. When someone clicks a button the form submitted via post like normal. HOWEVER. The page where the form resides is the default page(Default.aspx). So when someone goes to the site: http://site.com/ and submits the forms he gets redirected to http://site.com/default.aspx. I tried setting...