Is it possible for a UIWebView to save and autofill previously entered form values (e.g., username & password)?

From my looking I don’t think there is an easy way to do it. Here is an idea of what might work though: create your uiwebview create a nsurlrequest after your webview delegate page loaded function fires look in the request’s http body find the form for login (regex for common login forms?) retrieve give … Read more

Html.BeginForm() with an absolute URL?

BeginForm method has several overloads. In order to set the action attribute on the form tag with the desired url, you need to use following overload of BeginForm: BeginForm(String, String, FormMethod, IDictionary<String, Object>) // here are the parameter names: BeginForm(actionName, controllerName, method, htmlAttributes) Since you want to post to an external site, there is no … Read more

.js.erb VS .js

.js.erb files are for controller actions, such as create, when you want javascript to be executed when the action completes. For example, when you want to submit a form via ajax and want display an alert when everything is done, you would put the $(‘#business_submit’).click(…) in your application.js or *.html.erb, and your create.js.erb could look … Read more

How do I style radio buttons with images – laughing smiley for good, sad smiley for bad?

Let’s keep them simple, shall we. First off, using pure HTML + CSS: <div id=”emotion”> <input type=”radio” name=”emotion” id=”sad” /> <label for=”sad”><img src=”https://stackoverflow.com/questions/3896156/sad_image.png” alt=”I’m sad” /></label> <input type=”radio” name=”emotion” id=”happy” /> <label for=”happy”><img src=”happy_image.png” alt=”I’m happy” /></label> </div> This will degrade nicely if there’s no JavaScript. Use id and for attributes to link up the … Read more

POST vs post, GET vs get

W3C has tended towards lowercase for attribute names and values for a while. For example section 4.11 of the xhtml 1.0 standard in 2002: 4.11. Attributes with pre-defined value sets HTML 4 and XHTML both have some attributes that have pre-defined and limited sets of values (e.g. the type attribute of the input element). In … Read more

How do I use two submit buttons, and differentiate between which one was used to submit the form? [duplicate]

Give each input a name attribute. Only the clicked input‘s name attribute will be sent to the server. <input type=”submit” name=”publish” value=”Publish”> <input type=”submit” name=”save” value=”Save”> And then <?php if (isset($_POST[‘publish’])) { # Publish-button was clicked } elseif (isset($_POST[‘save’])) { # Save-button was clicked } ?> Edit: Changed value attributes to alt. Not sure this … Read more

tech