Search Results

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

Page 66/243 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • Updating form values with javascript

    - by shinjuo
    I have a page that I made that is going to be used for retrieving shipping rates from UPS by entering the weight and zip. Everything works fine but what I want to add to it is the ability for the user to choose something on a form and have it update the value in a different form box. I think this is done with javascript. Any suggestions will help.

    Read the article

  • Symfony2 Entity to array

    - by Adriano Pedro
    I'm trying to migrate my flat php project to Symfony2, but its coming to be very hard. For instance, I have a table of Products specification that have several specifications and are distinguishables by its "cat" attribute in that Extraspecs DB table. Therefore I've created a Entity for that table and want to make an array of just the specifications with "cat" = 0... I supose the code is this one.. right? $typeavailable = $this->getDoctrine() ->getRepository('LabsCatalogBundle:ProductExtraspecsSpecs') ->findBy(array('cat' => '0')); Now how can i put this in an array to work with a form like this?: form = $this ->createFormBuilder($product) ->add('specs', 'choice', array('choices' => $typeavailableArray), 'multiple' => true) Thank you in advance :) # Thank you all.. But now I've came across with another problem.. In fact i'm building a form from an existing object: $form = $this ->createFormBuilder($product) ->add('name', 'text') ->add('genspec', 'choice', array('choices' => array('0' => 'None', '1' => 'General', '2' => 'Specific'))) ->add('isReg', 'choice', array('choices' => array('0' => 'Material', '1' => 'Reagent', '2' => 'Antibody', '3' => 'Growth Factors', '4' => 'Rodents', '5' => 'Lagomorphs'))) So.. in that case my current value is named "extraspecs", so i've added this like: ->add('extraspecs', 'entity', array( 'label' => 'desc', 'empty_value' => ' --- ', 'class' => 'LabsCatalogBundle:ProductExtraspecsSpecs', 'property' => 'specsid', 'query_builder' => function(EntityRepository $er) { return $er ->createQueryBuilder('e'); But "extraspecs" come from a relationship of oneToMany where every product has several extraspecs... Here is the ORM: Labs\CatalogBundle\Entity\Product: type: entity table: orders__regmat id: id: type: integer generator: { strategy: AUTO } fields: name: type: string length: 100 catnumber: type: string scale: 100 brand: type: integer scale: 10 company: type: integer scale: 10 size: type: decimal scale: 10 units: type: integer scale: 10 price: type: decimal scale: 10 reqcert: type: integer scale: 1 isReg: type: integer scale: 1 genspec: type: integer scale: 1 oneToMany: extraspecs: targetEntity: ProductExtraspecs mappedBy: product Labs\CatalogBundle\Entity\ProductExtraspecs: type: entity table: orders__regmat__extraspecs fields: extraspecid: id: true type: integer unsigned: false nullable: false generator: strategy: IDENTITY regmatid: type: integer scale: 11 spec: type: integer scale: 11 attrib: type: string length: 20 value: type: string length: 200 lifecycleCallbacks: { } manyToOne: product: targetEntity: Product inversedBy: extraspecs joinColumn: name: regmatid referencedColumnName: id HOw should I do this? Thank you!!!

    Read the article

  • FormsAuthentication.RedirectFromLoginPage reload page

    - by Dofs
    Hi, I am using the .Net memebership system, and uptil now I haven't had any real troubles with it. I now have a overlay where a user can create a profile. When the profile is created I just want to redirect to the same page, and not to the default page or the return url - which doesn't exists. I have tried to stop the FormsAuthentication.RedirectFromLoginPage response, but with no effect: FormsAuthentication.RedirectFromLoginPage(username, false); // End the redirect so it doesnt redirect to default url (front-page) Response.End(); Response.Redirect(Request.RawUrl); Does anyone have an idea to how this can be solved?

    Read the article

  • Zend framework multiple Validators in an array

    - by iSenne
    Hello everybody I want to create a form in Zend framework. I am using the code below for a field: $this->addElement('text', 'username', array( 'label' => 'Username:', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array( 'alnum' ) )); This works. But now I also want to add a new validator. In this case StrinLength $element->addValidator('StringLength', false, array(6, 20)); How can I add this validator in the array I already have? Tnx in advanced

    Read the article

  • PHP code not working on IE

    - by Michael Frey
    I have a website with a flag. If it is clicked, the language of the website changes. Here is the code displaying the flag, which is a form with post event: <?php $pagename = $_SERVER['REQUEST_URI']; echo '<form action="'.$pagename.'" method="post"> <input name="formlanguage" type="image" '; if ($_SESSION['lang'] == 0) { echo 'alt="English" src="images/en.png" value="1" '; } else { echo 'alt="Deutsch" src="images/de.png" value="0" '; } echo '/></form>'; ?> Here is the response to that, and this part always fails on IE: if (isset($_POST['formlanguage'])) { $_SESSION['lang']=$_POST['formlanguage']; } I can not figure out why it works on Chrome but not IE. I assume that it might be a setting of IE. But what could that be?

    Read the article

  • jQuery hold form submit until "continue" button pressed

    - by Seán McCabe
    I am trying to submit a form, which I have had working, but have now modified it to include a modal jQuery UI box, so that it won't submit until the user presses "continue". I've had various problems with this, including getting the form to hold until that button is pressed, but I think I have found a solution to that, but implementing it, I am getting a SyntaxError which I can't find the source of. With the help of kevin B managed to find the answer was the form was submitting, but the returned JSON response wasn't quite formatted right. The response was that the form wasn't being submitted, so that problem is still occurring. So updated the code with the provided feedback, now need to find out why the form isnt submitting. I know its something to do with the 2nd function isnt recognising the submit button has been pressed, so need to know how to submit that form data without the form needing to be submitted again. Below is the new code: function submitData() { $("#submitProvData").submit(function(event) { event.preventDefault(); var gTotal, sTotal, dfd; var dfd = new $.Deferred(); $('html,body').animate({ scrollTop: 0 }, 'fast'); $("#submitProvData input").css("border", "1px solid #aaaaaa"); $("#submitProvData input[readonly='readonly']").css("border", "none"); sTotal = $('#summaryTotal').val(); gTotal = $('#gptotal').val(); if(gTotal !== 'sTotal'){ $("#newsupinvbox").append('<div id="newsupinvdiagbox" title="Warning - Totals do not match" class="hidden"><p>Press "Continue", to submit the invoice flagged for attention.</p> <br /><p class="italic">or</p><br /> <p>Press "Correct" to correct the discrepancy.</p></div>') //CREATE DIV //SET $("#newsupinvdiagbox").dialog({ resizable: false, autoOpen:false, modal: true, draggable: false, width:380, height:240, closeOnEscape: false, position: ['center',20], buttons: { 'Continue': function() { $(this).dialog('close'); reData(); }, // end continue button 'Correct': function() { $(this).dialog('close'); return false; } //end cancel button }//end buttons });//end dialog $('#newsupinvdiagbox').dialog('open'); } return false; }); } function reData() { console.log('submitted'); $("#submitProvData").submit(function(resubmit){ console.log('form submit'); var formData; formData = new FormData($(this)[0]); $.ajax({ type: "POST", url: "functions/invoicing_upload_provider.php", data: formData, async: false, success: function(result) { $.each($.parseJSON(result), function(item, value){ if(item == 'Success'){ $('#newsupinv_window_message_success_mes').html('The provider invoice was uploaded successfully.'); $('#newsupinv_window_message_success').fadeIn(300, function (){ reset(); }).delay(2500).fadeOut(700); } else if(item == 'Error'){ $('#newsupinv_window_message_error_mes').html(value); $('#newsupinv_window_message_error').fadeIn(300).delay(3000).fadeOut(700); } else if(item == 'Warning'){ $('#newsupinv_window_message_warning_mes').html(value); $('#newsupinv_window_message_warning').fadeIn(300, function (){ reset(); }).delay(2500).fadeOut(700); } }); }, error: function() { $('#newsupinv_window_message_error_mes').html("An error occured, the form was not submitted"); $('#newsupinv_window_message_error').fadeIn(300); $('#newsupinv_window_message_error').delay(3000).fadeOut(700); }, cache: false, contentType: false, processData: false }); }); }

    Read the article

  • Using javascript to add form fields, but what will the new name be?

    - by user1322844
    After reading this post: using javascript to add form fields.. but below, not to the side? I've made the button work! But I don't know how to receive the output. This is what I entered. var counter = 0; function addNew() { // Get the main Div in which all the other divs will be added var mainContainer = document.getElementById('mainContainer'); // Create a new div for holding text and button input elements var newDiv = document.createElement('div'); // Create a new text input var newText = document.createElement('input'); newText.type = "input"; newText.maxlength = "50"; newText.maxlimit = "50"; newText.size = "60"; newText.value = counter; // Create a new button input var newDelButton = document.createElement('input'); newDelButton.type = "button"; newDelButton.value = "Delete"; // Append new text input to the newDiv newDiv.appendChild(newText); // Append new button input to the newDiv newDiv.appendChild(newDelButton); // Append newDiv input to the mainContainer div mainContainer.appendChild(newDiv); counter++; // Add a handler to button for deleting the newDiv from the mainContainer newDelButton.onclick = function() { mainContainer.removeChild(newDiv); } } </script> With this in the form: <input type="button" size="3" cols="30" value="Add" onClick="addNew()"> So, what will the new field names be? I don't understand enough of the coding to figure out what I'm telling it to. Good thing there are other smart folks out there for me to lean on! Thanks for any answers.

    Read the article

  • How to customize an OpenFileDialog using nested types?

    - by vitorbal
    Say I wanted to customize an OpenFileDialog and change, for example, the way the filter for file extensions work, as in the case of this question. After I pointed out to the author of said question that the OpenFileDialog is not inheritable, I got a comment with the following: Even though the OpenFileDialog is sealed (not inheritable), you may use it as a nested type. For instance, using a property that will get the NativeDialog. Then, you write your method always using the NativeDialog property and you're done. My question is, can someone provide me with an example code on how would I proceed on doing something like that? I'm kind of new to the concept of nested types so I'm having a hard time figuring that out by myself, and I searched around the web and couldn't find anything too concrete about it. Thanks!

    Read the article

  • Get drop down menu value on Jqery

    - by Jerry
    Hi all Got a simple question. I would like to get a drop down menu value when a use clicks it. I tried to write the code on my own, but couldn't do it. Any helps would be appreciated. My Jquery $("#week").change(function(){ var input=$("week: select").val(); alert(input); //display undefiend My Html <form id="week"> <select> <option>Week 1</option> <option>Week 2</option> <option>Week 3</option> <option>Week 4</option> <option>Week 5</option> </select> </form>

    Read the article

  • Codeigniter - form not rendering on live server?

    - by pingu
    hi guys, I've written a small website with CI, which is all working fine on dev. However, when I copy the files over for live, everything works except for my form which is not being rendered. I am using <?php echo form_open('home'); ?> and <?php echo form_close(); ?> The form fields within the form, which I'm generating as follows are being rendered fine, but there is simply no form around them?! <?php $data = array( 'name'=> 'name', 'id'=> 'name', 'class'=>'textfield', 'value' => set_value('name') ); echo form_input($data); ?> Any ideas - I've used CI on a few apps, and this is the first time I've come across this issue. I've got all the helpers etc called correctly, as this is working perfectly in the development environment.

    Read the article

  • Remove application entry from switch-app menu

    - by bdhar
    What am I trying to achieve? I am writing a windows-form based application in C# .NET 2.0. The application should behave like this: No form should be visible; just a system tray icon is the entire application. So, I have to hide the form during startup and make a NotifyIcon available in the system tray with a ContextMenuStrip attached to it. What have I done so far? I have created a Windows application with the default form's properties WindowState-Minimized and ShowInTaskbar-false. Added a NotifyIcon and attached a ContextMenuStrip to it. What's happening? The application starts as a system tray icon and the form is hidden. So far so good. But when I am working with other applications and when I switch between other application using the Alt-Tab combination in Windows, the application icon appears in the switch-application menu; and when I select my application, the form appears. What's expected? The application should not be available in the switch-application menu; because, the form is empty and there is no functionality attached to it. All that is needed is the system-tray icon. How to hide the application entry from the switch-application menu? Thanks.

    Read the article

  • In .NET, how do I prevent, or handle, tampering with form data of disabled fields before submission?

    - by David
    Hi, If a disabled drop-down list is dynamically rendered to the page, it is still possible to use Firebug, or another tool, to tamper with the submitted value, and to remove the "disabled" HTML attribute. This code: protected override void OnLoad(EventArgs e) { var ddlTest = new DropDownList() {ID="ddlTest", Enabled = false}; ddlTest.Items.AddRange(new [] { new ListItem("Please select", ""), new ListItem("test 1", "1"), new ListItem("test 2", "2") }); Controls.Add(ddlTest); } results in this HTML being rendered: <select disabled="disabled" id="Properties_ddlTest" name="Properties$ddlTest"> <option value="" selected="selected">Please select</option> <option value="1">test 1</option> <option value="2">test 2</option> </select> The problem occurs when I use Firebug to remove the "disabled" attribute, and to change the selected option. On submission of the form, and re-creation of the field, the newly generated control has the correct value by the end of OnLoad, but by OnPreRender, it has assumed the identity of the submitted control and has been given the submitted form value. .NET seems to have no way of detecting the fact that the field was originally created in a disabled state and that the submitted value was faked. This is understandable, as there could be legitimate, client-side functionality that would allow the disabled attribute to be removed. Is there some way, other than a brute force approach, of detecting that this field's value should not have been changed? I see the brute force approach as being something crap, like saving the correct value somewhere while still in OnLoad, and restoring the value in the OnPreRender. As some fields have dependencies on others, that would be unacceptable to me.

    Read the article

  • Why is my asp.net mvc form POSTing instead of GETting?

    - by quakkels
    My code is straightforward enough: <% using(Html.BeginForm(FormMethod.Get)) %> <% { %> Search for in Screen Name and Email: <%: Html.TextBox("keyword", Request.QueryString["keyword"]) %> <button type=submit>Search</button> <% } %> The issue I'm running into is that when I submit this form, the values are not added to the querystring. Instead, it appears that the form is submitting by a post request. When I look at the generated HTML, I have this: <form action="/find/AdminMember/MemberList" method="post"> Search for in Screen Name and Email: <input id="keyword" name="keyword" type="text" value="" /> <button type=submit>Search</button> </form> Does anyone know why? This seems pretty simple and straighforward to me.

    Read the article

  • IE6 and IE7 Input padding CSS

    - by Podlsk
    I have input boxes with a height of 25 pixels. In Firefox, Safari and IE8 automatically vertically align the text of it in the middle correctly. However in IE6 and IE7 the text is aligned to the top. How may I resolve this? Adding padding-top increased the total height of the input as I have explicitly declared its height. I don't wish to use browser specific CSS. Thanks.

    Read the article

  • How to block non-browser clients from submitting a request?

    - by Thomas Kohl
    I want to block non-browser clients from accessing certain pages / successfully making a request. The website content is served to authenticated users. What happens is that our user gives his credentials to our website to 3rd party - it can be another website or a mobile application - that performs requests on his behalf. Say there is a form that the user fills out and sends a message. Can I protect this form so that the server processing the submission can tell whether the user has submitted it directly from the browser or not? I don't want to use CAPTCHA for usability reasons. Can I do it with some javascript?

    Read the article

  • formtastic - :string field value as Array and not found-s

    - by Alexey Poimtsev
    Hi, is there any possibility to send from formtastic form value of :string field like - semantic_form_for :project do |form| - form.inputs do = form.input :task_ids, :as => :string as Array? Currently value of this field is sending as String and i'd like to no parse this string in controller. Also, could you give me idea - if task with submitted id is not found - what is best way to catch this situation - validation in controller or what?

    Read the article

  • using ajax to post comments in cakephp results in 404 error, but no errors locally?

    - by Paul
    Using an ajax helper created for use with Jquery I've created a form that posts comments to "/comments/add", and this works as expected on my local wamp server but not on my production server. On my production server I get a '404 error, cannot find /comments/add'. I've spent quite a bit of time searching for a resolution with no luck so far. I've focused on trying to identify a gap but nothing jumps out at me. Here are some observations: works as expected on local wamp server requestHandler is listed as component files on both local and production server are the same controllers folder has write access autoLayout and autoRender are both set to false Here is the form in my view: <div class="comments form"> <?php echo $ajax->form('/comments/add', 'tournament', array('url' => '/comments/add', 'update' => 'Comments', 'indicator' => 'commentSaved'));?> <fieldset> <legend><?php __('Add Comment');?></legend> <div id="commentSaved" style="display: none; float: right;"> <h2>Loading...</h2> </div> <?php echo $form->hidden('Comment.foreign_id', array('value' => $tournament['Tournament']['id'])); echo $form->hidden('Comment.belongs_to', array('value' => 'Tournament')); echo $form->input('Comment.name'); echo $form->input('Comment.email'); echo $form->input('Comment.web', array('value' => 'http://')); echo $form->input('Comment.content'); ?> </fieldset> <?php echo $form->end('Submit');?> </div> And here is my 'comment's controller add action: function add() { if($this->RequestHandler->isAjax()) { $this->autoLayout = false; $this->autoRender=false; $this->Comment->recursive =-1; $commentInfos = $this->Comment->findAllByIp($_SERVER['REMOTE_ADDR']); $spam = FALSE; foreach($commentInfos as $commentInfo) { if ( time() - strtotime($commentInfo['Comment']['created']) < 180) { $spam = TRUE; } } if ($spam === FALSE) { if (!empty($this->data)) { $this->data['Comment']['ip'] = $_SERVER['REMOTE_ADDR']; $this->Comment->create(); if ($this->Comment->save($this->data)) { $this->Comment->recursive =-1; $comments = $this->Comment->findAll(array('Comment.foreign_id' => $this->data['Comment']['foreign_id'], 'Comment.belongs_to' => $this->data['Comment']['belongs_to'], 'Comment.status' =>'approved')); $this->set(compact('comments')); $this->viewPath = 'elements'.DS.'posts'; $this->render('comments'); } } } else { $this->Comment->recursive =-1; $comments = $this->Comment->findAll(array('Comment.foreign_id' => $this->data['Comment']['foreign_id'], 'Comment.belongs_to' => $this->data['Comment']['belongs_to'], 'Comment.status' =>'approved')); $this->set(compact('comments')); $this->viewPath = 'elements'.DS.'posts'; $this->render('spam'); } } else { $this->Session->setFlash(__('Invalid Action. Please view a post to add a comment.', true)); $this->redirect(array('controller' => 'pages', 'action'=>'display', 'home')); } } As you can see I've made sure that 'autoLayout' and 'autoRender' are set to false, but in Firebug I still get a 404 error stating /comments/add cannot be found on the production server. I should also point out that I'm using jquery, jquery.form and jquery.editable as well as a ajax helper created to be used with jquery. Any help or even suggestions about how to trouble shoot this is really appreciated. Cheers, Paul

    Read the article

  • Can one form have multiple actions?

    - by Brook Julias
    I am wanting to submit a form to different places based on selections made in the form. If the user wants to delete elements go to page 1. If the user wants to edit/update elements go to page 2. If the user wants to group/attach elements go to page 3.

    Read the article

  • file_field is not sticky in my Rails form

    - by Tony
    I have a pretty standard Rails form: <div> <h1>Create a New Listing</h1> <%- form_for @listing, :html => {:multipart => true} do |f| -%> <div><%= f.label :title, "Title:"%> <%= f.text_field :title %></div> <div> <%= f.label :image, "Image:" %> <%= f.file_field :image </div> <div> <%= f.label :sound, "Sound Clip:"%> <%= f.file_field :sound %><br /> </div> <div class="submit"><%= f.submit 'Post Listing' %></div> <%- end -%> </div> When a user chooses a file, but the form fails for validation purposes, he must always re-select the file. It is not sticky. Any suggestion on how to fix this? Thanks!

    Read the article

  • Javascript Function for related select elements onSubmit

    - by Livingston
    I am trying to create (4) Select elements within a form element. Each select element has a different number of options. So if a user click one option on Select #1 and then click another option on Select #2, after hitting submit they will be taken to www.blah.com/option1/option2 page which will display the filtered results. Or they can chose an option from all 4 select menus and be taken to option1/option2/option3/option4 page. The categories are all related .Select #1 is a category, Select #2 is a subcategory of 1, Select #3 is a subcategory of #2 and Select #4 is a subcategory of #3. A great example would be on (LINK) http://www.safavieh.com/rugs (LINK) except only four Select elements. I would also like to add the "Reset" button next to "Submit." I know I need to construct a function in my header and use onSubmit attribute within the form but other than that I am unsure of what's involved so I'm hoping someone could point me in the right direction. It's important I learn most of this for myself. Thanks for your time Livingston

    Read the article

  • PROBLEM: PHP strip_tags & multi-dimensional array form parameter

    - by Tunji Gbadamosi
    I'm having problems stripping the tags from the textual inputs retrieved from my form so as to do something with them in checkout.php. The input is stored in a multi-dimensional array. Here's my form: echo '<form name="choose" action="checkout.php" method="post" onsubmit="return validate_second_form(this);">'; echo '<input type="hidden" name="hidden_value" value="'.$no_guests.'" />'; if($no_guests >= 1){ echo '<div class="volunteer">'; echo '<fieldset>'; echo '<legend>Volunteer:</legend>'; echo '<label>Table:</label>'; echo '<select name="volunteer_table">'; foreach($tables as $t){ echo '<option>'.$t.'</option>'; } echo '</select><br><br>'; echo '<label>Seat number:</label>'; echo '<select name="volunteer_seat">'; foreach($seats as $seat){ echo '<option>'.$seat.'</option>'; } echo '</select><br><br>'; //echo '<br>'; echo '</fieldset>'; echo '</div>'; for($i=0;$i<$no_guests;$i++){ $guest = "guest_".$i; echo '<div class="'.$guest.'">'; echo '<fieldset>'; echo '<legend>Guest '.$i.':</legend>'; echo '<label>First Name:</label>'; echo '<input type="text" name="guest['.$i.']['.$first_name.']" id="fn'.$i.'">'; echo '<label>Surname:</label>'; echo '<input type="text" name="guest['.$i.']['.$surname.']" id="surname'.$i.'"><br><br>'; echo '<label>Date of Birth:</label> <br>'; echo '<label>Day:</label>'; echo '<select name="guest['.$i.'][dob_day]">'; for($j=1;$j<32;$j++){ echo"<option value='$j'>$j</option>"; } echo '</select>'; echo '<label>Month:</label>'; echo '<select name="guest['.$i.'][dob_month]">'; for($j=0;$j<sizeof($month);$j++){ $value = ($j + 1); echo"<option value='$value'>$month[$j]</option>"; } echo '</select>'; echo '<label>Year:</label>'; echo '<select name="guest['.$i.'][dob_year]">'; for($j=1900;$j<$year_limit;$j++){ echo"<option value='$j'>$j</option>"; } echo '</select> <br><br>'; echo '<label>Sex:</label>'; echo '<select name="guest['.$i.']['.$sex.']">'; echo '<option>Female</option>'; echo '<option>Male</option>'; echo '</select><br><br>'; echo '<label>Table:</label>'; echo '<select name="guest['.$i.']['.$table.']">'; foreach($tables as $t){ echo '<option>'.$t.'</option>'; } echo '</select><br><br>'; echo '<label>Seat number:</label>'; echo '<select name="guest['.$i.']['.$seat_no.']">'; foreach($seats as $seat){ echo '<option>'.$seat.'</option>'; } echo '</select><br><br>'; //echo '<br>'; echo '</fieldset>'; echo '</div>'; } } else{ echo '<div id="volunteer">'; echo '<fieldset>'; echo '<legend>Volunteer:</legend>'; echo '<label>Table:</label>'; echo '<select name="volunteer['.$table.']">'; foreach($tables as $t){ echo '<option>'.$t.'</option>'; } echo '</select><br><br>'; echo '<label>Seat number:</label>'; echo '<select name="volunteer['.$seat_no.']">'; foreach($seats as $seat){ echo '<option>'.$seat.'</option>'; } echo '</select><br><br>'; //echo '<br>'; echo '</fieldset>'; echo '</div>'; } echo '<input type="submit" value="Submit form">'; echo '</form>'; here's checkout.php: if(isset($_POST['guest'])){ foreach($_POST['guest'] as $guest){ $guest['first_name'] = strip_tags($guest['first_name']); $guest['surname'] = strip_tags($guest['surname']); } //$_SESSION['guest'] = $guests; }

    Read the article

  • How can I organize many results in a selectbox using php?

    - by zeckdude
    I have a select box that is part of a form. It is currently querying the addresses table and displaying the addresses into the select box. I plan on having up to 100 addresses. I'm looking for a solution where I can show all the states if the user clicks on the select box. Then if the user hovers over a state it will show all the addresses for that specific state. Then if the user clicks on an address, it will show that as the picked option in the select box. This is like a dropdown menu within a select box. Does anyone know where I can find a solution as this?

    Read the article

  • How to add default value on save form?

    - by Ignacio
    I have an object Task and a form that saves it. I want to automatically asign created_by field to the currently logged in user. So, my view is this: def new_task(request, task_id=None): message = None if task_id is not None: task = Task.objects.get(pk=task_id) message = 'TaskOK' submit = 'Update' else: task = Task(created_by = GPUser(user=request.user)) submit = 'Create' if request.method == 'POST': # If the form has been submitted... form = TaskForm(request.POST, instance=task) if form.is_valid(): task = form.save(commit=False); task.created_by = GPUser(user=request.user) task.save() if message == None: message = 'taskOK' return tasks(request, message) else: form = TaskForm(instance=task) return custom_render('user/new_task.html', {'form': form, 'submit': submit, 'task_id':task.id}, request) The problem is, you guessed, the created_by field doesn't get saved. Any ideas? Thanks

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >