Search Results

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

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

  • How do I reset a form in an ajax callback?

    - by B.Gordon
    I am sending a form using simple ajax and returning the results in a div above the form. The problem is that after the form is submitted and validated, I display a thank you and want to reset the form so they don't just press the submit button again... Can't seem to find the right code to do this... <form id="myForm" target="sendemail.php" method="post"> <div id="results"></div> <input type="text" name="value1"> <input type="text" name="value2"> <input type="submit" name="submit"> </form> So, my sendemail.php validation errors and success messages appear in #results without problems. But... when I try to send back a javascript form reset command, it does not work. Naturally I cannot see it in the source code since it is an AJAX callback so I don't know if that is the issue or if I am just using the wrong syntax. echo "<p>Thank you. Your message has been accepted for delivery.</p>"; echo "<script type=\"text/javascript\">setTimeout('document.getElementById('myForm').reset();',1000);</script>"; Any ideas gurus?

    Read the article

  • Deselecting a form input and waiting for a function before submitting

    - by blcArmadillo
    I have a form with an input field where a user enters a unique identifier. I then have some jQuery code that upon the user moving away from the input field (blur) goes out and fetches details about the part and populates some fields on the page. The problem is if the user clicks the submit button before moving out of the input field the jQuery code never has a chance to load in the data and populate the necessary fields. Whats the best way to go about doing this? I thought about maybe setting the focus to body and then having an infinite loop that keeps checking the page until all fields that should be filled in have been filled in but I feel like some sort of event based solution would be better than unpredictable infinite loops. Any ideas?

    Read the article

  • Login and Redirect

    - by xRobot
    This is my login views: def login(request): redirect_to = request.REQUEST.get("next") if request.method == 'POST': formL = LoginForm(data=request.POST) if formL.is_valid(): if not redirect_to or '//' in redirect_to or ' ' in redirect_to: redirect_to = "/blogs/" from django.contrib.auth import login login(request, formL.get_user()) if request.session.test_cookie_worked(): request.session.delete_test_cookie() return HttpResponseRedirect(redirect_to) else: formL = LoginForm(request) request.session.set_test_cookie() return render_to_response('blogs.html', { 'formL': formL, }, context_instance=RequestContext(request)) login = never_cache(login) When I go, for example, to example.com/myblog/ then I have been redirect to example.com/accounts/login/?next=/myblog/ but when I insert user and psw for login then I have been redirect to /blogs/ and not /myblog/ Why ?

    Read the article

  • TinyMCE clearing changes on form submit

    - by DCD
    I've added a toggle button to TinyMCE (using the jQuery plugin version) that looks like: $('a.mce_show').click(function(){ // toggle all textareas $('.wysiwyg').tinymce().show(); }); $('a.mce_hide').click(function(){ // toggle all textareas $('.wysiwyg').tinymce().hide(); }); The problem is if you hide the editor, make a change and click 'submit' it'll discard the change. If you hide the editor, make a change, show the editor then click submit it'll be fine. How do I get it to submit properly without having to re-show the editor?

    Read the article

  • Best way to create preview functionality in Rails

    - by slythic
    Hi all, I'm looking to implement preview functionality in my posts scaffold. All I need to do is allow a user to enter information in the new view (/posts/new) and then replace the submit button with a preview button. Once the preview button is clicked, the user is routed to the preview page (probably /posts/new/preview). If the user wants to make a change they would click 'go back' or if they are happy with the post they can then submit the post. I found this article (http://eyedeal.team88.org/node/105) but it seems dated. Any ideas on what the best approach for this would be? Many thanks, Tony

    Read the article

  • How to achieve multiple grids like the SQL server Results pane

    - by Skun
    Hi guys ! I'm having problems with my project once again :( The front end is C# I need to support multiline querying like MS SQL server and when these queries are executed, naturally there are going to be multiple result sets. Getting the datatables respective to the results is not a problem, but how do i make it appear like its done in MS SQL server. One result set below the other and with a scroll bar? Should i bind it to a datagrid? If so how can i bind multiple tables to a datagrid ? and will it generate the scrollbars and the columns automatically? If i am not clear, please let me know and i'll try to be more clearer. ps: If anyone knows how this can be done with the XtraGridControl in devexpress that would be awesome ! :D

    Read the article

  • How to configure tomcat 6.0 for mysql

    - by Dusk
    I'm using Tomcat 6.0, and I want to know how can I configure Tomcat's server.xml file to connect to mysql database, and enable form based authentication in java. I'm currently using mysql 5.1, and I've already downloaded mysql connector jar file, and put in lib directory of Tomcat.

    Read the article

  • Can't get custom error rendering to work in symfony 1.4

    - by hongkildong
    I'm tring to customize error rendering in my form according to this example. Here is my code: if ($this['message']->hasError()) { $error_msg = '<ul>'; foreach ($this['message']->getError() as $error) $error_msg .= "<li>$error</li>"; $error_msg .= '</ul>'; } return $error_msg; but when $this['message'] has error this code returns '<ul></ul>' so it seems foreach ($this['message']->getError() as $error) causes no iterations $this['message']->getError() returns sfValidatorError object - maybe something changed in symfony 1.4 and it isn't iterable anymore... At first I thought that all magic in that example happened because of object being placed in $error by iteration implements __toString() but it seems no iterations happens at all...

    Read the article

  • Load thumbnail image into PictureBox from directory

    - by zaidwaqi
    Hi, I use the following code to get thumbnail of image in Resources, and display on Picturebox. Image tmp = (System.Drawing.Image)myManager.GetObject(tempImage); cfgPassPicture[m].Image = tmp.GetThumbnailImage(40, 40, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), System.IntPtr.Zero); How do I do this for images in directory (instead of resources), given only the URL? I can load image into PictureBox via ImageLocation property, but not sure how to use Image property of PictureBox for this. Thanks

    Read the article

  • Form not sending full data

    - by gAMBOOKa
    I have a form with over 50 input fields. The input fields are divided into 5 jquery jabs within the form container. Here's a sample of what it looks like: <form action="admin/save" method="post" enctype="multipart/form-data"> <input type="hidden" name="type" value="department" /> <input type="hidden" name="id" value="21" /> <div id="tabs"> <ul> <li><a href="#tab-1">Tab 1</a><li> <li><a href="#tab-2">Tab 2</a><li> <li><a href="#tab-3">Tab 3</a><li> </ul> <div id="tab-1"> <label>Name</label> <input type="text" name="user-name" /> </div> <div id="tab-2"> <label>Address</label> <input type="text" name="user-address" /> </div> <div id="tab-3"> <label>Phone</label> <input type="text" name="user-phone" /> </div> </div> <input type="submit" value="Send" /> </form> I'm using PHP's Kohana framework, so admin maps to a controller, and save maps to the method action_save. When I output the $_POST variables in action_save, only 'type' and 'id' show up, all the other fields don't seem to submit their data. What could I be doing wrong?

    Read the article

  • send form data as web service in symfony

    - by Lars
    I am making a restrictive portal to a WiFi network using symfony, and I want to send a form as web service to other sites that want to use this portal. How should I solve this? I realize I could go the SOAP/WSDL route, but since symfony is already RESTful, it seems to me I could go the RESTful route with considerably less pain and loss of performance. Right now, I have a working form, but I've only made a casual attempt to bring the form to a remote site by using cURL. The form does not work remotely since the routing is not set up correctly (I think). Can someone help me with this? Thanks.

    Read the article

  • How to add target of Nlog to a specific textbox control, so the log messages will be shown in that c

    - by Sachin
    I have used following config of NLog to add the log text to control of specified Name on specified form. <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <targets> <target name="control" xsi:type="FormControl" append="true" controlName="textBox1" formName="Form1"/> </targets> <rules> <logger name="*" minlevel="Debug" writeTo="control"/> </rules> </nlog> I have a form with name Form1 and control on it with the name textBox1. Still nLog cretes a new form in runtime and adds a docked textbox to it and shows the logs in it. Now how to make nLogwrite the logs to MY form and MY Control

    Read the article

  • Drupal Module Development: How to Communicate between form_submit and page handler functions

    - by Aaron
    I am writing a module and I need to retrieve values set in a form_submit function from a page handler function. The reason is that I am rendering results of a form submit on the same page as the page handler. I have this working, but I am using global variables, which I don't like. I'd like to be able to use the $form_state['storage'] for this, but can't since I don't have access to the $form_state variable from the page handler. Any suggestions?

    Read the article

  • use jquery to toggle disabled state with a radio button

    - by hbowman
    I want to toggle two radio buttons and select fields based on which radio button is selected. I have the jQuery working, but want to know if there is a way to make it more efficient. Seems like quite a few lines for the simple goal I am trying to achieve. Here are the requirements: when the page loads, #aircraftType should be checked and #aircraftModelSelect should be grayed out (right now, the "checked" is being ignored by Firefox). If the user clicks either #aircraftType or #aircraftModel, the opposite select field should become disabled (if #aircraftModel is checked, #aircraftTypeSelect should be disabled, and vise versa). Any help on optimizing this code is appreciated. Code is up on jsfiddle too: http://jsfiddle.net/JuRKn/ $("#aircraftType").attr("checked"); $("#aircraftModel").removeAttr("checked"); $("#aircraftModelSelect").attr("disabled","disabled").addClass("disabled"); $("#aircraftType").click(function(){ $("#aircraftModelSelect").attr("disabled","disabled").addClass("disabled"); $("#aircraftTypeSelect").removeAttr("disabled").removeClass("disabled"); }); $("#aircraftModel").click(function(){ $("#aircraftTypeSelect").attr("disabled","disabled").addClass("disabled"); $("#aircraftModelSelect").removeAttr("disabled").removeClass("disabled"); }); HTML <div class="aircraftType"> <input type="radio" id="aircraftType" name="aircraft" checked /> <label for="aircraftType">Aircraft Type</label> <select size="6" multiple="multiple" id="aircraftTypeSelect" name="aircraftType"> <option value="">Light Jet</option> <option value="">Mid-Size Jet</option> <option value="">Super-Mid Jet</option> <option value="">Heavy Jet</option> <option value="">Turbo-Prop</option> </select> </div> <div class="aircraftModel"> <input type="radio" id="aircraftModel" name="aircraft" /> <label for="aircraftModel">Aircraft Model</label> <select size="6" multiple="multiple" id="aircraftModelSelect" name="aircraftModel"> <option value="">Astra SP</option> <option value="">Beechjet 400</option> <option value="">Beechjet 400A</option> <option value="">Challenger 300</option> <option value="">Challenger 600</option> <option value="">Challenger 603</option> <option value="">Challenger 604</option> <option value="">Challenger 605</option> <option value="">Citation Bravo</option> </select> </div>

    Read the article

  • IsAuthenticated is false! weird behaviour + review question

    - by Naor
    This is the login function (after I validate user name and password, I load user data into "user" variable and call Login function: public static void Login(IUser user) { HttpResponse Response = HttpContext.Current.Response; HttpRequest Request = HttpContext.Current.Request; FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, user.UserId.ToString(), DateTime.Now, DateTime.Now.AddHours(12), false, UserResolver.Serialize(user)); HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket)); cookie.Path = FormsAuthentication.FormsCookiePath; Response.Cookies.Add(cookie); string redirectUrl = user.HomePage; Response.Redirect(redirectUrl, true); } UserResolver is the following class: public class UserResolver { public static IUser Current { get { IUser user = null; if (HttpContext.Current.User.Identity.IsAuthenticated) { FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity; FormsAuthenticationTicket ticket = id.Ticket; user = Desrialize(ticket.UserData); } return user; } } public static string Serialize(IUser user) { StringBuilder data = new StringBuilder(); StringWriter w = new StringWriter(data); string type = user.GetType().ToString(); //w.Write(type.Length); w.WriteLine(user.GetType().ToString()); StringBuilder userData = new StringBuilder(); XmlSerializer serializer = new XmlSerializer(user.GetType()); serializer.Serialize(new StringWriter(userData), user); w.Write(userData.ToString()); w.Close(); return data.ToString(); } public static IUser Desrialize(string data) { StringReader r = new StringReader(data); string typeStr = r.ReadLine(); Type type=Type.GetType(typeStr); string userData = r.ReadToEnd(); XmlSerializer serializer = new XmlSerializer(type); return (IUser)serializer.Deserialize(new StringReader(userData)); } } And the global.asax implements the following: void Application_PostAuthenticateRequest(Object sender, EventArgs e) { IPrincipal p = HttpContext.Current.User; if (p.Identity.IsAuthenticated) { IUser user = UserResolver.Current; Role[] roles = user.GetUserRoles(); HttpContext.Current.User = Thread.CurrentPrincipal = new GenericPrincipal(p.Identity, Role.ToString(roles)); } } First question: Am I do it right? Second question - weird thing! The user variable I pass to Login has 4 members: UserName, Password, Name, Id. When UserResolver.Current executed, I got the user instance. I descided to change the user structure - I add an array of Warehouse object. Since that time, when UserResolver.Current executed (after Login), HttpContext.Current.User.Identity.IsAuthenticated was false and I couldn't get the user data. When I removed the Warehouse[] from user structure, it starts to be ok again and HttpContext.Current.User.Identity.IsAuthenticated become true after I Login. What is the reason to this weird behaviour?

    Read the article

  • Pass a value to an inFrame

    - by user106707
    This probably an easy thing to do but for some reason I can't get a handle on it. I have a simple form that allows people to select one if three items for sale. When they chose their item I need to pass that variable into an iFrame with a third party checkout page to safely process their cc transaction. How would I do this? Cheers-

    Read the article

  • Sanitizing user input that will later be e-mailed - what should I be worried about?

    - by Kevin Burke
    I'm interning for an NGO in India (Seva Mandir, http://sevamandir.org) and trying to fix their broken "subscribe to newsletter" box. Because the staff isn't very sophisticated and our web host isn't great, I decided to send the relevant data to the publications person via mail() instead of storing it in a MySQL database. I know that it's best to treat user input as malicious, and I've searched the SO forums for posts relevant to escaping user data for sending in a mail message. I know the data should be escaped; what should I be worried about and what's the best way to sanitize the input before emailing it? Form flow: 1. User enters email on homepage and clicks Submit 2. User enters name, address, more information on second page (bad usability, I know, but my boss asked me to) and clicks "Submit" 3. Collect the data via $_POST and email it to the publications editor (and possibly send a confirmation to the subscriber). I am going to sanitize the email in step 2 and the other data in step 3. I appreciate your help, Kevin

    Read the article

  • How do I insert an input's value into a separate form?

    - by ryan
    I'm making a tool for my university that allows students to create a list of classes by doing the following: Searching by course title for their course via an autocomplete input field. Adding that course to a separate form that upon being submitted creates a course list. I am trying to link the autocomplete and the course list form with an 'add to course list' button that inserts a hidden input field into the course list form which can subsequently be submitted by a 'create course list' button. My question is this: How do I take the value of the autocomplete input and insert it into the course list form without using AJAX? So far I have something like the following: <%= text_field_with_auto_complete :course, :title, :size => 40 %> <%= link_to_function "Add to Course List" do |page| page.insert_html :top, :course_list, hidden_field(:courses, :course, {:value => "$('course_title').value"}) %> <% form_for(@course_list) do |f|%> <div id="course_list">Insert selected courses here.</div> <% end %>

    Read the article

  • FormsAuthentication.SetAuthCookie

    - by Miral
    hi we are using FormsAuthentication.SetAuthCookie(profile.Id, false); Now the question is when does this cookie expires? It ofcourse expires once i close all the browsers but it doesn't i keep the browser open and i dont know the timelimit.

    Read the article

  • Rails does not display error messages on a form in a custom method

    - by slythic
    Hi all, I've created a custom method called checkout in my app. I create an order (which is done my adding products to my "cart"), assign it to my client, and then I head to my checkout screen where I confirm the items and enter their customer order number and complete the order (submit). Everything works great except that it doesn't display error messages. I'm able to display a flash error notice (seen in complete_order method) when things go wrong but it doesn't specify the details like a normal form would. The error messages should appear if the customer order number is not unique for that client. Below is the custom method (checkout) related code. Order Model: validates_uniqueness_of :customer_order_number, :scope => :client_id Orders_controller: def checkout @order = current_order end def complete_order @order = current_order respond_to do |format| if @order.update_attributes(params[:order]) @order.complete #sets submitted datetime and state to 'complete' flash[:notice] = 'Thank you! Your order is being processed.' format.html { redirect_to( products_path ) } format.xml { head :ok } else flash[:error] = 'Please review your items' #added to confirm an error is present format.html { redirect_to( checkout_path ) } format.xml { render :xml => @order.errors, :status => :unprocessable_entity } end end end And the form in the checkout view: <% form_for @order, :url => { :controller => "orders", :action => "complete_order" } do |f| %> <%= f.error_messages %> <%= f.text_field :customer_order_number, :label => "Purchase Order Number" %> <p> <%= f.submit 'Complete Order', :confirm => 'Are you sure?' %> <small> or <%= link_to 'cancel', current_cart_path %></small> </p> <% end %> Any idea how I can display the specific error messages? Thank you in advance! -Tony

    Read the article

  • Assigning Datasource to a region

    - by minal
    Hi, I was wondering if there is an existing control that I could use to achieve what I am trying. Basically, I have a html table that I display my header information. It looks something like this: <table class="tableEdit"> <tr> <th>Job ID</th><td>10</td> <th>Client</th><td>Tom</td> </tr> <tr> <th>Comments</th><td>Comments are here</td> </tr> </table> I am wondering if there is an existing control that I can use as a container. Then I can assign the datasource to that control and leverage the field values as such. <asp:Somecontrol runat="server" ID="someid"> <table class="tableEdit"> <tr> <th>Job ID</th><td><%# Eval("Id") %></td> <th>Client</th><td><%# Eval("Client.Name") %></td> </tr> <tr> <th>Comments</th><td><%# Eval("Comments") %></td> </tr> </table> </asp:Somecontrol> private void BindHeader() { SomeObjectType data = DAL.SomeMethod(); someid.Datasource = data; someid.DataBind(); } Is there anything out there to do this? I want to be able to control the layout of the fields within the container. Thanks.

    Read the article

  • Fill a rails form with a hashmap

    - by Ignace
    Hey, I have a difficult situation. I let the the user create a form through a Rich Text Editor and then I save this. So for example, I save this literally into my DB: http://pastebin.com/DNdeetJp (how can you post HTML here? It gets interpreted, so now I use pastebin...) On another page I wrap this in a form_tag and it gets presented as it should be. What I want to do is save this as a template and save the answers as a hashmap to my DB. This works well, but the problem is I want to recreate what checkbox/radiobutton/... is selected when the user goes back to the page. So I want to fill the form with the answers from the hashmap. Is there a way to use a 'dummy' model or something else to accomplish this? Thanks!

    Read the article

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