Search Results

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

Page 73/243 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • Writing custom Django form fields and widgets

    - by hekevintran
    Django has very good documentation that describes how to write custom database fields and custom template tags and filters. I cannot find the document that describes how to write custom form fields and widgets. Does this document exist? The way I've been able to write custom form fields and widgets is by reading the Django source code and imitating what I see there. I know that there are still things about implementing fields and widgets that I do not completely understand because I have not read any high level document that describes their interfaces.

    Read the article

  • need to upload multiple files each with different parameters

    - by OM The Eternity
    I have a form in which there are total eight fields, name, address, age and 5 other file/photo upload fields such that at a time one upload field is visible.. Now here every time I upload a file i need to fill the "name, address and age" as well. at this point I dont want to submit the form, but I just want to save these values in any variable and get back to same form with information of previous file ready to be submitted, now again user can upload new file with new values in... and so on... as user is done with the 5 files he should not be allowed to upload more but he should be allowed to submit all the 5 files to DB along with there supporting fields.. How should I proceed further ...?

    Read the article

  • jQuery mobile ajax login form authentication

    - by Jakub Zak
    I know i already asked simillar question, but now when I work with jQuery Mobile I can't figure it out. So I have this form: <div data-role="page" data-theme="a" id="login_page"> <div data-role="header" data-position="fixed"> <h1>****</h1> </div> <div data-role="content"> <form id="login_form" method="POST" data-ajax="false"> <label for="basic">Username:</label> <input type="text" name="name" id="username" value=""/> <label for="basic">Password:</label> <input type="password" name="password" id="password" value=""/> <input type="submit" value="Login" id="login" name="login"/> </form> </div> <div data-role="footer" data-position="fixed"> <div data-role="navbar"></div> </div> </div> And I need to submit Username and Password to php script, where php replies and send "success" or "failed". Here is php: <?php session_start(); $username = $_POST["name"]; $password = $_POST["password"]; include('mysql_connection.php'); mysql_select_db("jzperson_imesUsers", $con); $res1 = mysql_query("SELECT * FROM temp_login WHERE username='$username' AND password='$password'"); $count=mysql_num_rows($res1); if($count==1){ echo "success"; }else{ echo "failed"; } ?> And to do all this I want to use this script: $(document).ready(function() { $("form").submit(function(){ $.mobile.showPageLoadingMsg(); $.ajax({ url: "http://imes.jzpersonal.com/login_control.php", type: "POST", dataType: "jsonp", jsonp: "jsoncallback", data: $("form#login_form").serialize(), success: function( response ){ $.mobile.changePage( "http://imes.jzpersonal.com/user_panel.html"); } }); return false; }); }); But I can't make it work, I know I must have mistakes in there, I just can't find them, or better way to do it. Thank you in advance for any help.

    Read the article

  • Update Input Value With jQuery, Old Value Submitted to Form

    - by Tyler DeWitt
    I've got a form with an input with id/name league_id <form accept-charset="UTF-8" action="/user" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="?"><input name="authenticity_token" type="hidden" value="bb92urX83ivxOZZJzWLJMcr5ZSuamowO9O9Sxh5gqKo="></div> <input id="league_id" name="league_id" type="text" value="11"> <select class="sport_selector" id="sport_type_id" name="sport_type_id"><option value="5" selected="selected">Football</option> <option value="25">Women's Soccer</option> <option value="30">Volleyball</option> <option value="10">Men's Soccer</option></select> <input name="commit" type="submit" value="Save changes"> </form> In another part of my page, I have a drop down that, when changed, clears the value of league_id $("#sport_type_id").change -> $("#league_id").val(null) $(this).parents('form:first').submit() If I debug this page, I can see the value get wiped from the text box, but when the form is submitted, my controller always gets the old value. I tried changing the name of the input and got the same results.

    Read the article

  • How can i put my form value in javascript array

    - by Lucas van den Abbeele
    I want to make a script where i can put my form in the javascript array invoer[] and display the total It constantly stops working and i searched a lot, i really can't find the right way :D This is my javascript code var strijk = ['broek', 'hemd', 'tshirt', 'lakens', 'korte broek', 'babykledij']; var minuten = [5, 10, 5, 6, 3, 3]; function invoerstrijk() { document.write("<form action='' method='get' name='strijkform'>"); for (var a = 0; a < minuten.length; a++) { document.write(strijk[a] + "<input id='" + strijk[a] + "' name ='" + strijk[a] + "' type='text' />" + "<BR>"); } document.write("<button onclick='opgeven()'>opgeven</button>"); document.write("</form>"); } function opgeven() { var invoer = []; for (var a = 0; a < minuten.length; a++) { invoer[a] = document.getElementByI(strijk[a]).value; } var totaal; for (var a = 0; a < minuten.length; a++) { totaal += parseint(invoer[a]) * parseint(minuten[a]); } document.write("<input name=" + strijk[a] + " type='text' value=" + invoer[a] + " readonly />"); if (invoer != []) { document.write("totaal aantal minuten" + totaal); } else { document.write("geen invoer"); } } my html looks likes this <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <script type="text/javascript" > //my javasccript </script> <button id="B1" onclick="invoerstrijk()" >Nieuwe strijk</button> </body> </html>

    Read the article

  • How do I prevent form from redirecting after submission?

    - by Noor
    I have searched the site and I've found various solutions, most of them suggesting using return false; Problem is that I'm using this piece of code to submit the form: $(function() { $("#snd").click(function() { var dendar = "http://" + $("#inpt").val() + ":" + $("#pwd").val() + "secretsite.lol/something.xml"; $("#formen").attr("action", dendar); $("#formen").submit(); alert(dendar); return false; }); }); The alert is just there to let me know that the form has been submitted.. Thanks guys!

    Read the article

  • Does Len function only evaluate numerical results?

    - by Mel
    Why does the following code not output "Error" if the form is submitted with a blank field? Does Len only evaluate numerical values? <cfif NOT Len(Trim("Form.myField"))> <cfoutput>Error</cfoutput> </cfif> The following also does not evaluate as expected: <cfif Len(Trim("Form.myField")) IS 0> <cfoutput>Error</cfoutput> </cfif> HTML: <input type="text" name="myField" value="">

    Read the article

  • Javascript form validation events

    - by user307922
    Hi All, I am making a small form for a php app and had a question regarding javascript validation. What is the best event to run the javascript validation on the input value? Is it the "focusout" event? I used "focusout" to originally but it creates problems when the user hits enter while they are still focused on any particular field in the form. Should I run the js validation when the user clicks submit? Just looking for some advice. Thanks! Chuck

    Read the article

  • Codeigniter Form Validation - how to unset form values after success?

    - by BrynJ
    I realise this request goes against the example provided in the CI documentation (which advises a separate 'success' page view), but I would like to reutilise a given form view after a form has been successfully submitted - displaying a success message then displaying a blank form. I've tried a few ways unsuccessfully to clear the validation set values (unsetting $_POST, setting rules / fields to an empty array and rerunning validatio). I could redirect to the same page, but then I'd have to set a session variable to display a success message - which is a messy approach. Any ideas how to achieve the above?

    Read the article

  • A simple php form in Joomla?!

    - by Ben Fransen
    Hi all, Someone came to me and asked me if I could add a form to their Joomla page. I figured this should be easy since Joomla is widely used and such thing should be supported. I'm googling arround for 1,5h now, and I have given 4 formcreators a try but this is driving me crazy. The editors are all very complex for the simplest task I want. A simple form with: 5 text input; 1 radio selection criteria; the message a visitor sends. So I've given pretty much up upon formbuilders. Is there a simple way to include an external, self-built very easy php form, into the contactpage? I hope to hear from you... Greetings from Holland

    Read the article

  • Submtting data using $.ajax and retrieving values from $_POST array

    - by Linda Keating
    I'm having trouble retrieving my form Data that has been submitted via ajax like this: $( "form" ).on( "submit", function( event ) { var formData = $(this).serializeArray(); console.log("fomData"); $.ajax({ url: window.location.origin+ "/selfservicemanager/localtmfsetup/local_tmf_setup.php", type: "POST", data: JSON.stringify(formData), success : function (){ alert("success"); } }); }); I can see the data being sent over the network like this: But when I try to retrieve the data on the server side the $_POST array is empty. <?php var_dump($_POST); die(); ?> array (size=0) empty Any ideas? I've tried to stringify the data being sent, and also tried to decode the $_POST array but it expects a string.....

    Read the article

  • Option not clickable with mouse click after focus on select

    - by Manna
    I have configured a keyboard navigation for customized selects. Here the codepen to see in action : http://codepen.io/Mannaio/pen/ebyBi?editors=001 You can use the arrows up and down inside the selects and click the option with enter or tab button. I have a problem now and these are the steps reproduce the error 1) Do Focus on Input Name 2) Press Tab 3) If you hover and then do click with the mouse in any of the select options, they can not be selected with the mouse click This is the only error, it works perfectly if you move the arrows up and down and then you press the enter o tab, i want to to be able to select the option also with the mouse click after i do the focus with the tab button in the customized select Technically the problem is that the hover with the keyboards up and down is different when i hover with the mouse in the select-options. Line 185 function setSelected(menuitem) { $("ul.select-options.active li").removeClass("itemhover"); $("ul.select-options.active li").eq(menuitem).addClass("itemhover"); };

    Read the article

  • Store form values for later submission

    - by kim griggs
    I have a Rails app that lets users create tutorials and quizzes. There are many users taking the quizzes and many quizzes in a tutorial. My client wants the quiz results to persist when a student navigates away from the quiz. So the use case would be: User starts to take quiz User answers some of the questions User navigates away from quiz to check a fact in the tutorial User goes back to quiz and their answers are still there User finishes quiz and submits Now this would be pretty easy to do if I enforced a "Save" submit so that the answers could be stored in a session or whatever, but the client (and I agree) thinks people will not remember to save before navigating away. Looking for advice on how to approach this. I'm thinking an observer and cookies.

    Read the article

  • Rails - Create form fields dynamically and save them

    - by Frexuz
    Im building an ad-system where users can dynamically create 'fields' for each ad type. My models and example values: AdType: | id | name |----|----- | 1 | Hotel | 2 | Apartment AdOption: | id | ad_type_id | name |----|------------|----- | 1 | 1 | Star rating | 2 | 1 | Breakfast included? | 3 | 2 | Number of rooms AdValue: (Example after saving) | id | ad_id | ad_option_id | value |----|-------|---------------|------ | 1 | 1 | 1 (stars) | 5 | 2 | 1 | 2 (breakfast) | true Ad: (Example after saving) | id | description | etc.... |----|-----------------|-------- | 1 | very nice hotel | ....... So lets say I want to create a new ad, and I choose Hotel as the ad type. Then I need my view to dynamically create fields like this: (I'm guessing?) [Label] Star rating: [hidden_field :ad_id] [hidden_field :ad_option_id] [text_field :value] [Label] Breakfast included? [hidden_field :ad_id] [hidden_field :ad_option_id] [text_field :value] And also, how to save the values when the ad record is saved I hope this is understandable. If not just ask and I'll try to clarify.

    Read the article

  • Best way to distribute form that can be printed or saved?

    - by Jason Antman
    I need to develop a simple form (intended only for printing) to be filled in by arbitrary end users (i.e. no specialized software). Ideally, I'd like the end-user to be able to save their inputs to the form and update it periodically. It seems that (at least without LiveCycle Enterprise Suite) Adobe Reader won't save data input in a PDF form. Aside from just distributing the form as a Word document, does anyone have any suggestions? Background: I do some work for a volunteer ambulance corps. They have a lot of elderly patients who don't know (or can't remember) their medical history. They want to develop a common form with personal information (name, address, DOB, medications list, etc.) for elderly residents to hang on their refrigerators (apparently a common solution to this problem). As some of them (or their children/grandchildren) are computer literate, it would make most sense to provide a download-able blank form that can be filled in, saved, updated, and re-printed as needed. Due to worries about privacy, HIPAA, etc. anything with server-side generation is out, it needs to be 100% client-side, and in a format that the majority of non-technical computer users can access without additional software. Thanks for any tips... at this point, I'm leaning towards just using a .doc form.

    Read the article

  • Form Field: How do I change the background on blur?

    - by Liso22
    I managed to remove the background when the user clicks on the field but I cannot restore it when it blurs! This is the field: <textarea class="question-box" style="width: 240px; background: white url('http://chusmix.com/Imagenes/contawidget.png') no-repeat 50% 50%; color: grey;" cols="12" rows="5" id="question-box-' . $questionformid . '" name="title" onblur="if(this.value == '') { this.style.color='#848484'; this.value=''this.style.background=' white url('http://chusmix.com/Imagenes/contawidget.png') no-repeat 50% 50%;e';}" onfocus="if (this.value == '') {this.style.color='#444'; this.style.background='none';}" type="text" maxlength="200" size="28"></textarea> Anyone knows what I'm doing wrong?? Thanks

    Read the article

  • How to automatically select the selected item in list menu after submitting the form?

    - by SzamDev
    Hi I have this code : <form id="form2" name="form2" method="post" action=""> <table dir="ltr" width="554" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="269" class="da"><div align="center"><span id="spryselect1"> <select onchange="form2.submit()" name="mpage" id="mpage"> <option selected="selected" value="no">-----------</option> <option value="medmo">Medmo.com</option> <option value="paris">Paris.com</option> <option value="imo">IMO.com</option> </select> </span></div></td> <td width="214" class="t_b">Select Website</td> </tr> </table> </form> When the user select a value, the form will automatically submit, I want the item that the user has selected to be selected after submitting the form. Because I am facing this proplem: The user select the first item (Medmo.com) - form submit - selected item will be "-------" I want this to happen : The user select the first item (Medmo.com) - form submit - selected item will be "Medmo.com" How I can do that? Thanks in Advance.

    Read the article

  • Overriding the default error message for a ModelForm

    - by Jude Osborn
    Is there any way to override a error_message text for all the fields of a ModelForm's, without having to include all the field info in the ModelForm? For example, let's say I have a (very simple) model like this: People(models.Model): name = models.CharField(max_length=128, null=True, blank=True, help_text="Please type your name.") age = models.IntegerField(help_text="Please type your age.") I don't like the cut and dry default messages, such as, "Enter a whole number.", so I'd like to change them to something a bit nicer like "Please type a number." Ideally I'd be able to add an "error_message" property in the model, but the model does not support that property. So does that mean I have to basically duplicate all the model info in my ModelForm, or is there a way around that?

    Read the article

  • jQuery code works for console but not in-page.

    - by justSteve
    I have a form element defined as: <div class="field"> <div class="name"> <label for="User_LastName"> Last name: <span class="asterisk">*</span></label> </div> <div class="value"> <%= Html.TextBox("User.LastName", Model.LastName)%> <%= Html.ValidationMessage("User.LastName")%> </div> </div> and a jQuery selector that is supposed to detect when the input gets focus and highlight the parent: $("input").focus(function() { //watching for an event where an input form comes into focus $(this) .parent() .addClass("curFocus") .children("div") .toggle(); }); If i paste this code into firebug's console - things work as planned. However, i'm running this from a 'RenderPartial' .net mvc page. Other jQuery code sitting within the same $(document).ready(function() { block work correctly. The form uses html helpers to generate the inputs which might complicate the process somewhat - but even so... i'm seeing correct behavior when that code's in console but not in a 'real-time' page. How do i troubleshoot this?

    Read the article

  • Making two Windows using CreateWindowsEx()

    - by Jamie Keeling
    Hello, I have a windows form that has a simple menu and performs a simple operation, I want to be able to create another windows form with all the functionality of a menu bar, message pump etc.. as a separate thread so I can then share the results of the operation to the second window. I.E. 1) Form A opens Form B opens as a separate thread 2)Form A performs operation 3)Form A passes results via memory to Form B 4)Form B display results I'm confused as to how to go about it, the main app runs fine but i'm not sure how to add a second window if the first one already exists. I think that using CreateWindow will allow me to make another window but again i'm not sure how to access the message pump so I can respond to certain events like WM_CREATE on the second window. I hope it makes sense. Thanks! Edit: I've attempted to make a second window and although this does compile, no windows show atall on build. ////////////////////// // WINDOWS FUNCTION // ////////////////////// LRESULT CALLBACK WindowFunc(HWND hMainWindow, UINT message, WPARAM wParam, LPARAM lParam) { //Fields WCHAR buffer[256]; struct DiceData storage; HWND hwnd; // Act on current message switch(message) { case WM_CREATE: AddMenus(hMainWindow); hwnd = CreateWindowEx( 0, "ChildWClass", (LPCTSTR) NULL, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 0, hMainWindow, NULL, NULL, NULL); ShowWindow(hwnd, SW_SHOW); break; Any suggestions as to why this happens?

    Read the article

  • Input checkbox name converts period signs into underlines on post

    - by Rakoon
    Hello I am working on an image gallery at the moment. When a user is logged in, an x appears over each image and a checkbox next to it to enable the user to delete that image. Only if the checkbox is checked will the image be deleted. They are both in a (one for each image in the gallery), the small image "x.gif" is an input type="image" that submits the $_POST form. The checkbox inherits the name of the image and is to prevent accidentally pressing the x button and deleting an image. The problem is that the checkbox name, upon posting it gets converted from (for instance) "Image.jpg" to "Image_jpg" When i test it with print_r($_POST); Should I create code for replacing _jpg or _gif into .jpg and .gif after the post or is there a way to make it possible to use period signs in input names? Any help is greatly appreciated.

    Read the article

  • Stop PHP from creating arrays in $_POST superglobal

    - by cdmckay
    PHP will automatically convert <input type="text" name="foo[0]" value="x" /> <input type="text" name="foo[1]" value="y" /> into $_POST['foo'] = array( 0 => 'x', 1 => 'y' ); Which is what you want most of the time. However, in this case I would like this not to happen. Is there anyway to tell PHP to not do this? I realize I could parse php://input myself, but I'd rather not do that if I can avoid it. I also don't have the option of renaming the input names.

    Read the article

  • JSP JPA Form: how to insert value in a path variable

    - by kajarigd
    I have the following code snippet in a jsp file: <hr> <form:form commandName="newTicketSale" id="reg" action="transactionResult.htm"> <h3>Buy Movie Tickets:</h3> <form:label path="movieName">Movie Name:</form:label> <form:input path="movieName" /> <form:errors class="invalid" path="movieName" /> <form:label path="ticketPrice">Ticket Price:</form:label> <form:input path="ticketPrice" /> <form:errors class="invalid" path="ticketPrice" /> <input type="submit"> <br><br> </form:form> I am using JPA tags in this jsp. Now, in the commandName "newTicketSale" there is another parameter called userId. In the jsp file itself I need to insert value ${name} in userId, so that in the Controller file when I am doing @Valid @ModelAttribute("newTicketSale") MovieTicket newTicket I can retrieve the value ${name} when I am doing newTicket.getUserId(). I don't know how to do this. Please help! Thanks in advance!

    Read the article

  • Form is creating already loaded attributes in addition to new attributes, how do I ignore the first?

    - by looloobs
    In my application you: Have an admin user that signs on and that user has a role (separate model), then I use the declarative_authorization plugin to give access to certain areas. That admin user can also register new users in the system, when they do this (using Authlogic) they fill out a nested form that includes that new users' role. So what is happening is the role of the admin user is being loaded by the declarative_authorization and then the nested form using the has_many_nested_attributes is loading that existing role as well as the new role for the new user (users can have many roles). Is there some way I can tell the new User being created to ignore the role assigned to the current_user and only create the role in the form for the new user? I have looked through a lot of different things, but it seems to get more complicated that these are nested attributes. Thanks in advance.

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >