Search Results

Search found 6055 results on 243 pages for 'forms'.

Page 63/243 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • Submitting a form on 'Enter' with jQuery?

    - by b. e. hollenbeck
    I have a bog-standard login form - an email text field, a password field and a submit button on an AIR project that's using HTML/jQuery. When I hit Enter on the form, the entire form's contents vanish, but the form isn't submitted. Does anyone know if this is a Webkit issue (Adobe AIR uses Webkit for HTML), or if I've bunged things up? I tried: $('.input').keypress(function(e){ if(e.which == 13){ $('form#login').submit(); } }); But that neither stopped the clearing behavior, or submitted the form. There's no action associated with the form - could that be the issue? Can I put a javascript function in the action?

    Read the article

  • Reset form with jQuery

    - by da5id
    I have a form with a standard reset button coded thusly: <input type="reset" class="button standard" value="Clear" /> Trouble is, said form is of the multi-stage sort, so if a user fills out a stage & then returns later, the 'remembered' values for the various fields won't reset when the Clear button is clicked. I'm thinking that attaching a jQuery function to loop over all the fields and clear them 'manually' would do the trick. I'm already using jQuery within the form, but am only just getting up to speed & so am not sure how to go about this, other than individually referencing each field by ID, which doesn't seem very efficient. TIA for any help.

    Read the article

  • How to pass form errors in session or flash? [Rails 2.3.5]

    - by yuval
    I have a create action for a form that potentially generates errors (i.e. first name is missing) and then redirects. The problem is, that when the redirect happens those form errors get lost. How could I pass those form errors in a session to be displayed back in the original form (which should still be filled out with the previous details, as in the original error_messages behavior)? Thanks!

    Read the article

  • cant access nested ressource 'comments' in rails 3.0.1

    - by DannyRe
    Hey, I hope you can help me. /config/routes.rb resources :deadlines do resources :comments end /model/comment.rb class Comment < ActiveRecord::Base belongs_to :post, :class_name = "Post", :foreign_key = "post_id" end /model/post.rb class Post < ActiveRecord::Base has_many :comments end When I want to visit: http://localhost:3000/posts/1/comments/new it says: undefined method `comments_path' for #<#:0x4887138 in _form.html I use 'formtastic' and the _form.html.erb looks like this: <% semantic_form_for [@comment] do |form| % <% form.inputs do % <%= form.input :content % <% end % <% form.buttons do % <%= form.commit_button % <% end % <% end %

    Read the article

  • radio value lost by $_post array

    - by YsoL8
    Hello I have this simple form: <form method="post" action="?step=2"> <label>A4 - Colour / Colour <input type="radio" name="leaflet" value="1"></label><br> <label>A5 - Colour / Black <input type="radio" name="leaflet" value="2"></label><br> <input type="submit" name="leaflet" value="Select"> </form> When I apply print_r ($_POST); to the submission though, I only get the submit button data. I don't even see the radio name. What could do that?

    Read the article

  • how to decrypt a string

    - by Avinash
    Hi, How to restore the value of a string after using FormsAuthentication.HashPasswordForStoringInConfigFile() i have a string s1 = "abc" then FormsAuthentication.HashPasswordForStoringInConfigFile(s1, "SHA1") = A9993E364706816ABA3E25717850C26C9CD0D89D How can i decrypt "A9993E364706816ABA3E25717850C26C9CD0D89D" back to "abc"??

    Read the article

  • Storing JSON in an SQL Server database?

    - by JKirchartz
    I'm developing a form generator, and wondering if it would be bad mojo to store JSON in an SQL Server database? I want to keep my database & tables simple, so I was going to have `pKey, formTitle, formJSON` on a table, and then store {["firstName":{"required":"true","type":"text"},"lastName":{"required":"true","type":"text"}} in formJSON. would this slow down the DB server too much to set live? Any input is appreciated.

    Read the article

  • does sfWidgetFormSelect provide a string or an int of the selected item?

    - by han
    Hey guys, I'm having an annoying problem. I'm trying to find out what fields of a form were changed, and then insert that into a table. I managed to var_dump in doUpdateObjectas shown in the following public function doUpdateObject($values) { parent::doUpdateObject($values); var_dump($this->getObject()->getModified(false)); var_dump($this->getObject()->getModified(true)); } And it seems like $this-getObject()-getModified seems to work in giving me both before and after values by setting it to either true or false. The problem that I'm facing right now is that, some how, sfWidgetFormSelect seems to be saving one of my fields as a string. before saving, that exact same field was an int. (I got this idea by var_dump both before and after). Here is what the results on both var dumps showed: array(1) {["annoying_field"]=> int(3)} array(1) {["annoying_field"]=>string(1)"3"} This seems to cause doctrine to think that this is a modification and thus gives a false positive. In my base form, I have under $this->getWidgets() 'annoying_field' => new sfWidgetFormInputText(), under $this->setValidators 'annoying_field' => new sfValidatorInteger(array('required' => false)), and lastly in my configured Form.class.php I have reconfigured the file as such: $this->widgetSchema['annoying_field'] = new sfWidgetFormSelect(array('choices' => $statuses)); statuses is an array containing values like {""a", "b", "c", "d"} and I just want the index of the status to be stored in the database. And also how can I insert the changes into another database table? let's say my Log table? Any ideas and advice as to why this is happen is appreciated, I've been trying to figure it out and browsing google for various keywords with no avail. Thanks! Edit: ok so I created another field, integer in my schema just for testing. I created an entry, saved it, and edited it. this time the same thing happened!

    Read the article

  • Html shows after submitting form and is nowhere to be found in php script.

    - by Kelbizzle
    Upon submitting this form on my site. It send me to a page that says. "Use Back - fill in all fields Use back! ! " But this html isn't in the mail script anywhere. Where could this be coming from? I started out using this contact form (http://www.ibdhost.com/contact/) then changed it a little. Here is the mail script. <?php session_start(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Sendemail Script</title> </head> <body> <!-- Reminder: Add the link for the 'next page' (at the bottom) --> <!-- Reminder: Change 'YourEmail' to Your real email --> <?php //the 3 variables below were changed to use the SERVER variable $ip = $_SERVER['REMOTE_ADDR']; $httpref = $_SERVER['HTTP_REFERER']; $httpagent = $_SERVER['HTTP_USER_AGENT']; $visitorf = $_POST['visitorf']; $visitorl = $_POST['visitorl']; $visitormail = $_POST['visitormail']; $visitorphone = $_POST['visitorphone']; //$notes = $_POST['notes']; //$attn = $_POST['attn']; $lookup = array( 'The Election Report' => 'http://www.mydowmain.net/', '5 Resons' => 'http://www.mydomain.net/', 'Report 3' => 'http://someotherurl3.com/', 'Report 4' => 'http://someotherurl4.com/', 'Report 5' => 'http://someotherurl5.com/', // et cetera for your other values ); $attn = trim($_POST['attn']); $url = $lookup[$attn]; //echo 'attn: ' . $attn . ', url:' . $url; die; //additional headers $headers = 'From: US <[email protected]>' . "\r\n"; //$headers .= 'BCC: [email protected]' . "\r\n"; $todayis = date("l, F j, Y, g:i a") ; $subject = "your lead has downloaded a report."; $subjectdp = "Someone has downloaded a report!"; $notes = stripcslashes($notes); $message = "Dear PAl Affiliate,\n\nA prospective lead of yours has downloaded a report from our Website.\nAny contact information they have left and a link to the report they downloaded\ncan be found below. This is the perfect opportunity for you to open up a line of\ncommunication with the prospect and find out their intrests! If you have any questions\nabout this email please feel free to email us at [email protected]\n\n\nFrom: $visitorf $visitorl ($visitormail)\nTelephone Number: $visitorphone \nReport Downloaded:$url\n \n\nBest regards,\nThe Crew"; //$message = "$todayis [EST] \nAttention: \nMessage: $notes \nFrom: $visitorf $visitorl ($visitormail) \nTelephone Number: //$visitorphone \nReport Downloaded:$url\nAdditional Info : IP = $ip \nBrowser Info: $httpagent \nReferral : $httpref\n"; $messagedp = "A Visitor has just downloaded a report. You can find their contact information below.\n \n ***********************************************************************\n From: $visitorf $visitorl\n Email: $visitormail\n Telephone Number: $visitorphone \n Report Downloaded:$url\n \n \n Best regards,\n The Crew\n"; $messagelead = "Dear, $visitorf\n \n \n We appreciate your interest. Below you will find the URL to download the report you requested.\n Things are always changing in costa rica , so check back often. Also, check us out on Facebook & Twitter \n for daily updates. If there is anything we can do at anytime to enhance your experience, please do\n not hesitate to contact us.\n \n To download your report simply click on the link below. (You must have Adobe Reader or an alternative PDF reader installed)\n \n *** Download Link ***\n $url\n"; //check if the function even exists if(function_exists("mail")) { //send the email mail($_SESSION['email'], $subject, $message, $headers) or die("could not send email"); } else { die("mail fucntion not enabled"); } //send the email to us mail('[email protected]', $subjectdp, $messagedp); //send the email to the lead mail($visitormail, 'Thanks for downloading the report!', $messagelead, $headers); header( "Location: http://www.mydomain.com/thanks_report.php" ); ?> </body> </html>

    Read the article

  • Usability standards when combining AJAX and regular POST-based form saves

    - by mcrider
    I'm working on a project where on certain pages (e.g. settings pages) we combine AJAX and regular fill-out-the-form-then-submit POST based operations. I'm curious if anyone has advice on improving the usability of such a page. One of my ideas is that when the user enters/modifies a value in a non-ajax part of the page, some sort of div would appear (say in a fashion similar to Growl) indicating that the user needs to save by pressing 'Submit' at the bottom of the page (and possibly putting up a modal dialog if the user navigates away from the page before saving, though that might be a bit too intrusive). I'm sure this type of interaction exists, but I can't find any examples.

    Read the article

  • Inline Form Validation in Django

    - by allanhenderson
    Newbie request that seems difficult to implement. I would like to make an entire inline formset within an admin change form compulsory.. so in my current scenario when I hit save on an Invoice form (in Admin) the inline Order form is blank. I'd like to stop people creating invoices with no orders associated. Anyone know an easy way to do that? Normal validation like (required=True) on the model field doesn't appear to work in this instance. Thanks!!

    Read the article

  • Django ModelFormSet with Google app engine

    - by Eric
    I'm using Django with google app engine. I'm using the google furnished django app engine helper project. I'm attempting to create a Django modelformset like this: #MyModel inherits from BaseModel MyFormSet = modelformset_factory(models.MyModel) However, it's failing with this error: 'ModelOptions' object has no attribute 'fields' Apparently modelformset_factory() is expecting MyModel to implement a 'fields' accessor. Anybody successfully used a modelformset with GAE datastore? Or is this a fundamental incompatibility between Django and GAE?

    Read the article

  • How to post Arabic characters in PHP

    - by Peter Stuart
    Okay, So I am writing an OpenCart extension that must allow Arabic characters when posting data. Whenever I post ????? the print_r($_POST) returns with this: u0645u0631u062du0628u0627 I check the HTML header and it has this: <meta charset="UTF-8" /> I checked the PHP file that triggers all SQL queries and it has this code: mysql_query("SET NAMES 'utf8'", $this->link); mysql_query("SET CHARACTER SET utf8", $this->link); mysql_query("SET CHARACTER_SET_CONNECTION=utf8", $this->link); This is in my form tag: <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form" accept-charset="utf-8"> I can't think of what else I am doing wrong. The rest of the OpenCart framework supports UTF8 and arabic characters. It is just in this instance where I can't post anything arabic? Could someone please help me? Many Thanks Peter

    Read the article

  • Cache inferno - how can Model.A be two different things at the same time?

    - by Martin
    I have this <%=Model.StartDate%> <%=Html.Hidden("StartDate", Model.StartDate)%> it outputs: 2010-05-11 11:00:00 +01:00 <input type="hidden" value="2010-03-17 11:00:00 +01:00" name="StartDate" id="StartDate"> What the... It's a paging mechanism so the hidden value was valid on the first page and I've been able to move forward to the next page. But since the values won't update properly it ends there. What do I need to do. Using firefox.

    Read the article

  • Post ASP.Net Form data to another page

    - by william
    I have an ASP.Net Page, aspx with its default form. I have a Submit Button for it. Upon clicking, it will post the data to itself. In other words, Button Click Event() from code behind will execute the necessary. After that, I would like to post the same data to another ASp.Net Page, aspx from another domain. So, how can I do it? I tried creating a Form in Button Click Event and a javascript to Submit the Form so that it will post. But the Form is not appearing hence there is already aForm` on the page. Is there anyway to do it?

    Read the article

  • php mysql parallel array checkboxes

    - by gramware
    I have an array of checkboxes that I edit at once to set up a 'tinyint' field. the problem comes in when i uncheck the checkbox and post the vales to mysql. since it posts an array of checkboxes and another parallel array of values to edit, unchecking a checkbox results in the 0 value been ignored by PHP_POST and hence the checkbox array will be less by the number of unchecked values in the form while the array to be edited will have all the records in the form. here is the submit code while($row=mysql_fetch_array($result)) { $checked = ($row[active]==1) ? 'checked="checked"' : ''; ... echo "<input type='hidden' name='TrID[]' value='$TrID'>"; echo "<input type='checkbox' name='active1[]' value='$row[active]''$checked' >"; ... and the processing php script $userid = ($_POST['TrID']); $checked= ($_POST['active']); $i=0; foreach ($userid as $usid) { if ($checked[$i]==1){ $check = 1; } else{ $check = 0; } $qry1 ="UPDATE `epapers`.`clientelle` SET `active` = '$check' WHERE `clientelle`.`user_id` = '$usid' "; $result = mysql_query($qry1); $i++; }

    Read the article

  • How can I split a PHP form into two sections, before submission to a database?

    - by Daniel Smith
    Hi guys, I have set up a PHP form for a competition, for users to enter and all information to be stored in a database. I used the following NetTut+ tutorial to do so: http://tr.im/SwAd. I've got the form submitting to the database as required, but with so many additional questions being asked, I would like to split the form into two separate sections. Obviously the first page would say continue to the next step before the second step allowing for the form to be submitted to the database. The content that the user sees should be split, but should all be a part of the same form. Step 1 Step 2 before submission. Would anyone know of or recommend any methods to do this? I'm a beginner so please be nice. :) Cheers, Daniel

    Read the article

  • Editting ForeignKey from "child" table

    - by profuel
    I'm programming on py with django. I have models: class Product(mymodels.Base): title = models.CharField() price = models.ForeignKey(Price) promoPrice = models.ForeignKey(Price, related_name="promo_price") class Price(mymodels.Base): value = models.DecimalField(max_digits=10, decimal_places=3) taxValue = models.DecimalField("Tax Value", max_digits=10, decimal_places=3) valueWithTax = models.DecimalField("Value with Tax", max_digits=10, decimal_places=3) I want to see INPUTs for both prices when editing product, but cannot find any possibility to do that. inlines = [...] works only from Price to Product, which is stupid in this case. Thanx for adnvance.

    Read the article

  • Drupal 7: File field causes error with Dependable Dropdowns

    - by LoneWolfPR
    I'm building a Form in a module using the Form API. I've had a couple of dependent dropdowns that have been working just fine. The code is as follows: $types = db_query('SELECT * FROM {touchpoints_metric_types}') -> fetchAllKeyed(0, 1); $types = array('0' => '- Select -') + $types; $selectedType = isset($form_state['values']['metrictype']) ? $form_state['values']['metrictype'] : 0; $methods = _get_methods($selectedType); $selectedMethod = isset($form_state['values']['measurementmethod']) ? $form_state['values']['measurementmethod'] : 0; $form['metrictype'] = array( '#type' => 'select', '#title' => t('Metric Type'), '#options' => $types, '#default_value' => $selectedType, '#ajax' => array( 'event' => 'change', 'wrapper' => 'method-wrapper', 'callback' => 'touchpoints_method_callback' ) ); $form['measurementmethod'] = array( '#type' => 'select', '#title' => t('Measurement Method'), '#prefix' => '<div id="method-wrapper">', '#suffix' => '</div>', '#options' => $methods, '#default_value' => $selectedMethod, ); Here are the _get_methods and touchpoints_method_callback functions: function _get_methods($selected) { if ($selected) { $methods = db_query("SELECT * FROM {touchpoints_m_methods} WHERE mt_id=$selected") -> fetchAllKeyed(0, 2); } else { $methods = array(); } $methods = array('0' => "- Select -") + $methods; return $methods; } function touchpoints_method_callback($form, &$form_state) { return $form['measurementmethod']; } This all worked fine until I added a file field to the form. Here is the code I used for that: $form['metricfile'] = array( '#type' => 'file', '#title' => 'Attach a File', ); Now that the file is added if I change the first dropdown it hangs with the 'Please wait' message next to it without ever loading the contents of the second dropdown. I also get the following error in my JavaScript console: "Uncaught TypeError: Object function (a,b){return new p.fn.init(a,b,c)} has no method 'handleError'" What am I doing wrong here?

    Read the article

  • Why always fires OnFailure when return View() to Ajax Form ?

    - by Wahid Bitar
    I'm trying to make a log-in log-off with Ajax supported. I made some logic in my controller to sign the user in and then return simple partial containing welcome message and log-Off ActionLink my Action method looks like this : public ActionResult LogOn(LogOnModel model, string returnUrl) { if (ModelState.IsValid) { if (MembershipService.ValidateUser(model.UserName, model.Password)) { FormsService.SignIn(model.UserName, model.RememberMe); if (Request.IsAjaxRequest()) { //HERE IS THE PROBLEM :( return View("LogedInForm"); } else { if (!String.IsNullOrEmpty(returnUrl)) return Redirect(returnUrl); else return RedirectToAction("Index", "Home"); } } else { ModelState.AddModelError("", "The user name or password provided is incorrect."); if (Request.IsAjaxRequest()) { return Content("There were an error !"); } } } return View(model); } and I'm trying to return this simple partial : Welcome <b><%= Html.Encode(Model.UserName)%></b>! <%= Html.ActionLink("Log Off", "LogOff", "Account") %> and of-course the two partial are strongly-typed to LogOnModel. But if i returned View("PartialName") i always get OnFailure with status code 500. While if i returned Content("My Message") everything is going right. so please tell me why i always get this "StatusCode = 500" ??. where is the big mistake ??. By the way in my Site MasterPage i rendered partial to show long-on simple form this partial looks like this : <script type="text/javascript"> function ShowErrorMessage(ajaxContext) { var response = ajaxContext.get_response(); var statusCode = response.get_statusCode(); alert("Sorry, the request failed with status code " + statusCode); } function ShowSuccessMessage() { alert("Hey everything is OK!"); } </script> <div id="logedInDiv"> </div> <% using (Ajax.BeginForm("LogOn", "Account", new AjaxOptions { UpdateTargetId = "logedInDiv", InsertionMode = InsertionMode.Replace, OnSuccess = "ShowSuccessMessage", OnFailure = "ShowErrorMessage" })) { %> <%= Html.TextBoxFor(m => m.UserName)%> <%= Html.PasswordFor(m => m.Password)%> <%= Html.CheckBoxFor(m => m.RememberMe)%> <input type="submit" value="Log On" /> < <% } %>

    Read the article

  • [C#] Closing a MenuStrip programatically

    - by Nilbert
    I have a MenuStrip that I have added to a form, and in one of the dropdown menus in it, I have a text box. When I hit enter on the textbox, I want a function to run, then the drop down menu to close. I know how to get the enter part done, but I have no idea how to close the MenuStrip dropdown menu. Does anybody know how to do this?

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >