Search Results

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

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

  • Symfony Form render with Self Referenced Entity

    - by benarth
    I have an Entity containing Self-Referenced mapping. class Category { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * @ORM\Column(name="name", type="string", length=100) */ private $name; /** * @ORM\OneToMany(targetEntity="Category", mappedBy="parent") */ private $children; /** * @ORM\ManyToOne(targetEntity="Category", inversedBy="children") * @ORM\JoinColumn(name="parent_id", referencedColumnName="id") */ private $parent; } In my CategoryType I have this : public function buildForm(FormBuilderInterface $builder, array $options) { $plan = $this->plan; $builder->add('name'); $builder->add('parent', 'entity', array( 'class' => 'xxxBundle:Category', 'property' => 'name', 'empty_value' => 'Choose a parent category', 'required' => false, 'query_builder' => function(EntityRepository $er) use ($plan) { return $er->createQueryBuilder('u') ->where('u.plan = :plan') ->setParameter('plan', $plan) ->orderBy('u.id', 'ASC'); }, )); } Actually, when I render the form field Category this is something like Cat1 Cat2 Cat3 Subcat1 Subcat2 Cat4 I would like to know if it's possible and how to display something more like, a kind of a simple tree representation : Cat1 Cat2 Cat3 -- Subcat1 -- Subcat2 Cat4 Regards.

    Read the article

  • How to add default value on django 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

  • Django extending user model and displaying form

    - by MichalKlich
    Hello, I am writing website and i`d like to implement profile managment. Basic thing would be to edit some of user details by themself, like first and last name etc. Now, i had to extend User model to add my own stuff, and email address. I am having troubles with displaying form. Example will describe better what i would like achieve. This is mine extended user model. class UserExtended(models.Model): user = models.ForeignKey(User, unique=True) kod_pocztowy = models.CharField(max_length=6,blank=True) email = models.EmailField() This is how my form looks like. class UserCreationFormExtended(UserCreationForm): def __init__(self, *args, **kwargs): super(UserCreationFormExtended, self).__init__(*args, **kwargs) self.fields['email'].required = True self.fields['first_name'].required = False self.fields['last_name'].required = False class Meta: model = User fields = ('username', 'first_name', 'last_name', 'email') It works fine when registering, as i need allow users to put username and email but when it goes to editing profile it displays too many fields. I would not like them to be able to edit username and email. How could i disable fields in form? Thanks for help.

    Read the article

  • How can I make sure a ListView item always resizes to show all rows?

    - by Jon Cage
    I have a panel which contains a TableLayoutPanel which itself contains a number of ListViews and Labels. What I'd like is for each list view to resize to fit all of it's contents in vertically (i.e. so that every row is visible). The TableLayoutPanel should handle any vertical scrolling but I can't work out how to get the ListView to resize itself depending on the number of rows. Do I need to handle OnResize and manually resize or is there already something to handle this?

    Read the article

  • How does 37signals job preview functionality work?

    - by slythic
    Hi all, I'm interested in getting a preview functionality working similar to how the 37signals job site does: http://jobs.37signals.com. Below are some screen shots of how it works. Step 1. Create your ad http://cl.ly/dfc4761b015c7f43c8ab (URL /jobs/new) Step 2. Preview your ad http://cl.ly/9c4b4041cfea83d8569e (URL /jobs/new/preview) Step 3. Publish your ad http://cl.ly/a58284d90fd380d2c26b (URL /listings/new/purchase?token=5198) So assuming you have Post model where Step 1 usually takes place in the new/create view/actions, how should one continue to Step 2 Preview and then after previewing, proceeding to the Step 3 publishing the post/ad? Do they actually save the ad/post in the database before continuing to Step 2 (Preview) but set a flag (like a boolean field called preview set to true)? It looks like they set a token paramater but I'm not sure what it's used for) I'm interested in this because it seems to go against the CRUD/REST and I thought it would be good to know how it worked. Thanks!

    Read the article

  • Information sent in an HTML form

    - by dedalo
    Hi, I've a HTML file that shows to the user the contents of a database (it is shown as a table). The user can choose one of the rows.When this is done the selection made by the user is sent to a servlet that will work with that information. Imagine that this servlet is going to look for files related to the information chosen by the user. What I'd like to do is to provide the user with the option of also choosing the number of files that are going to be looked for by the servlet. That way the user should be able to choose one of the rows shown in the table and should also be able of typing the numers of files that are to be looked for. So far I'm able to send to the servlet what the user chooses in the table, but I'd like to know if it is possible to attach to this information the number of files requested. Thanks

    Read the article

  • I'm having trouble traversing a newly appended DOM element with jQuery

    - by culov
    I have a form that I want to be used to add entries. Once an entry is added, the original form should be reset to prepare it for the next entry, and the saved form should be duplicated prior to resetting and appended onto a div for 'storedEntries.' This much is working (for the most part), but Im having trouble accessing the newly created form... I need to change the value attribute of the submit button from 'add' to 'edit' so properly communicate what clicking that button should do. heres my form: <div class="newTruck"> <form id="addNewTruck" class='updateschedule' action="javascript:sub(sTime.value, eTime.value, lat.value, lng.value, street.value);"> <b style="color:green;">Opening at: </b> <input id="sTime" name="sTime" title="Opening time" value="Click to set opening time" class="datetimepicker"/> <b style="color:red;">Closing at: </b> <input id="eTime" name= "eTime" title="Closing time" value="Click to set closing time" class="datetimepicker"/> <label for='street'>Address</label> <input type='text' name='street' id='street' class='text' autocomplete='off'/> <input id='submit' class='submit' style="cursor: pointer; cursor: hand;" type="submit" value='Add new stop'/> <div id='suggests' class='auto_complete' style='display:none'></div> <input type='hidden' name='lat' id='lat'/> <input type='hidden' name='lng' id='lng'/> ive tried using a hundred different selectors with jquery to no avail... heres my script as it stands: function cloneAndClear(){ var id = name+now; $j("#addNewTruck").clone(true).attr("id",id).appendTo(".scheduledTrucks"); $j('#'+id).filter('#submit').attr('value', 'Edit'); $j("#addNewTruck")[0].reset(); createPickers(); } the element is properly cloned and inserted into the div, but i cant find a way to access this element... the third line in the script never works. Another problem i am having is that the 'values' in the cloned form revert back to the value in the source of the html rather than what the user inputs. advice on how to solve either of these issues is greatly appreciated!

    Read the article

  • C Builder TForm not allocated or created properly all its controls

    - by ergey
    Hi, I would know how i can check that all the controls on the form is created and initialized. I have form i am showing when user presses the 'update' button. It have only TProgressBar control. The handle is not NULL for this control and at random stages it can or can't set the Position/Max values. When i set TProgressBar-Max value to some integer it remains 0 after. So the question is: 1) How to really create the form and all controls on it (i am currently using just Form-Show() method, which as i can check calls the constructor) 2) How to check that all controls on the form is created and PAINTED (showed) Thanks

    Read the article

  • Why does the following Javascript/form not work?

    - by joshim5
    <form> <input type="text" id="inputbox" value="hello"/> <input type="submit" value="Convert" onClick="convert(document.getElementById("inputbox"))"/> </form> <script type="text/javascript"> function convert (text) { alert(text); return text; </script> This also does not work when I change alert to document.write. I obviously have more HTML to go along with this. Thanks!

    Read the article

  • Creating two Windows by running one as a process from another - C

    - 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 seperate process 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 process 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 hope it makes sense. Thanks!

    Read the article

  • Writing custom Django 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

  • javascript check function for a html form

    - by Reteras Remus
    I'm having a problem with a HTML form (name, e-mail, subject, message), I can't validate the form if it was completed correct or not. I want to call a javascript function when the form is submitted and alert if a field wasn't completed correct. My problem is with the submit button, because my boss said that I must use he's own php function to insert a submit button. The php function looke like: function normal_button($text, $width, $param = '', $class = 'button-blue') { $content = '<div class="'.$class.'" style="width:'.$width.'px;" '.$param.'>'.$text.'</div>'; return $content; } and how I call the function: echo normal_button('Send it', '100', 'onclick="document.getElementById(\'emailForm\').submit();" '); I tried to call the js function declaring the onSubmit="return checkForm(this)" in the <form action='email.php' method='post'> HTML form, but I can't "catch" the submit. Also I tried to catch it with jquery, $(document).ready(function() { $('.normal_button').click(function() { }); ); but I can't return false if a field wasn't completed correct. I must use he's PHP function to insert the submit button, but how can I "catch" the fields, how can I validate them? Any suggestions? Thank you !

    Read the article

  • Proper HTML technique to create an web form out of an image

    - by Lars
    I plan to create an interactive golf score card for my website (XHTML). (Btw. thats how such a scorecard looks like: ScoreCard). So at the end one should be able to insert a score for each hole in the appropriated input field in the virtual scorecard on the website. For me it is very important that the interactive scorecard really looks the same as the original (paper-) scorecard does and so my first approach was to scan and slice the scorecard image to reach that appearance. Here you can see the way I sliced the image: The idea was to insert HTML text input for each score field ending up with something like this: After I sliced the image I reconstructed it using the HTML . To do that I put the image slices as the cell background. <table> <tr> <td style="background: url("slice1.jpg") width="58px" height="25px"> <input type="text"></inputText> </td> </tr> ... </table> At the first moment this worked fine (as Gimp offers quite a nice feature for this). Then the problem was that I had to create a HTML table to create the exact layout. As you can see the lower part of the layout is split up into 3 columns. The middle column is split up into several (for each hole) rows. So the left and right column have to be spanned over those rows. Ok finally that worked, but it lead to some kind of scaling problem. If I zoom in or out on the table the middle column (and only that one) is not scaled the right way. Iam not able to fix this, and so I start doubting if this is the right technique for html image virtualization. Iam really no specialist in the area of creating websites, so I would really appriciate any help on this. Maybe there is a complete other and better technique to do that, as I think it is a common job in webcreation. I couldnt find any nice examples or tuts on that.

    Read the article

  • This code is not submitting to a form? Why

    - by Ankur
    Since I am using get I expect to see the submitted values appended to the queryString but instead all I see is the URL of the servlet being called with nothing added at the end. <form id="editClassList" name="editClassList" method="get" action="EditClassList"> <% HashMap<Integer,String> classes = new HashMap<Integer,String>(); classes = (HashMap<Integer,String>) request.getAttribute("classes"); %> <% if(classes.size()==0){ %> <label><input class="small-link" type="text" id="add-this-class" size="42" value="" /></label> <% } %> <% Set<Integer> classIds = new HashSet<Integer>(); classIds = classes.keySet(); Iterator<Integer> itr = classIds.iterator(); while(itr.hasNext()){ int nextId = (Integer)itr.next(); %> <label><input class="small-link" type="text" id="<% out.print(nextId); %>" size="42" value="<% out.print(classes.get(nextId)); %>" /> </label> <img id="add-class" src="images/add.png" width="16" height="16" /><br /> <label><input class="small-link" type="text" id="class-to-add" size="42" value="" /></label> <% } %> <label><input type="submit" id="save-class-btn" value="Save Class(es)" /></label> </form>

    Read the article

  • How to protect a form HTML/PHP with JS callback to AS3

    - by Jk_
    Hi guys, I'm developing a Flash website (as3) where I need to be able to upload directly to YouTube by using the DATA API. However in order to do so, I had to use a proper HTML form on top of my flash object. Why? Because of the Browser Based Upload restictions. I first hide the form using JQuery and with a little CSS the form is display just where I want it. Within flash I use ExternalInterface.call() to show/hide the form when I need it! ExternalInterface.call("YTUploader.showIt"); The upload process is working great my only problem is that the form can be displayed easily... You just need a tool like firebug and you can use the form wherever you want on my flash app. So I was wandering which will be the best way to 'protect' this form or the best way to limit its access. Any advices will be appreciated. Thanks for your time. Jk.

    Read the article

  • Why does setting a form's enabled property crash the application?

    - by Ruirize
    private void launchbutton_Click(object sender, EventArgs e) { launchbutton.Enabled = false; Process proc = new Process(); proc.EnableRaisingEvents = true; proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; //The arguments/filename is set here, just removed for privacy. proc.Exited += new EventHandler(procExit); proc.Start(); } private void procExit(object sender, EventArgs e) { MessageBox.Show("YAY","WOOT"); Thread.Sleep(2000); launchbutton.Enabled = true; } 2 Seconds after I quit the created process, my program crashes. Why?

    Read the article

  • change the return of to_param by action? or, terribly broken edit action if perma-url is returned in

    - by Stacia
    I did some stuff to have to_param return a perma-url so I'd have seo friendly links. Upon creation and update it will generate and return the perma-url in a to_param method that I put in the model. However this causing me some grief in other areas. I have a form that looks like this: <% @apps.each do |app| %> <% fields_for "[id][]", app do |fields| %> .... this fails terribly since it tries to insert the perma-url in place of the id. If I could just restrict to_param by action, that could solve things. If I change app to app.id, that fails since I have stuff like this: fields.check_box :is_featured . I suppose I could get the app instance, but that feels hacky. Again please excuse my lack of rails-foo ;)

    Read the article

  • Need help getting Wysihat to work

    - by slythic
    Hi all, I'm using Wysihat in a rails project and am stumped by it's inability to bind to my textarea named post_description (model name Post field name description). I have the following in my head tag: <%= javascript_include_tag 'prototype_1.7'%> <%= javascript_include_tag 'wysihat' %> <script type="text/javascript" charset="utf-8"> document.on("dom:loaded", function() { var editor = WysiHat.Editor.attach('post_description'); var toolbar = new WysiHat.Toolbar(editor); toolbar.addButtonSet(WysiHat.Toolbar.ButtonSets.Basic); // Hide our error message if the editor loads fine $('error').hide(); }); </script> I'm able to see Wysihat works (the bold, italic, and underline tools are shown and when click works as intended). The following in the source of the posts/new HTML: <div id="post_description_editor" class="editor" contenteditable="true"></div> <textarea cols="40" id="post_description" name="post[description]" rows="20" style="display: none; "></textarea> However, when I type something in the description field and click submit the post validation fails saying the description field is empty. Anyone have any clue on how I can get this to work? Thanks in advance!

    Read the article

  • Oversize cursor in Firefox form with textbox background image

    - by Gogster
    Hi all, I have a webform with background images on the textboxes to give them a nice rounded corner. In Chrome the textboxes work as expected, however, if I view the form in Firefox the cursor appears to size to the height of the image, but the text is a normal size. Is there a way to override this oversized cursor? Here is the CSS of the textbox: .ed_form_textbox { width:319px; height:34px; margin-bottom:10px; padding-left:10px; background: transparent url( "/images/textbox.png" ) no-repeat bottom left; position:relative; border:none; } Thanks.

    Read the article

  • CompareValidator date format

    - by ashtame
    Hi, I have an ajax calendar control that I specified the date format to be yyyy-MM-dd. Is it possible to have the comparevalidator validate that type of date sepcifically and have it fail for everything else? right now it seems to only take dd-MM-yyyy. Thanks.

    Read the article

  • submitHandler is an invalid label

    - by Steven
    Below is the code, I get an error which says that submitHandler is an invalid label $(document).ready(function() { $("#withdraw").validate({ rules: { amount: { required: true, number:true, min:0, max:<?php echo $balance; ?> } , bank:{ required:true, }, cardnumber1: { required: true, minlength:8 }, cardnumber2:{ required:true, equalTo: "#cardnumber1" }, holder:{ required:true, } } }), submitHandler: function(form){ var answer = confirm("Do you really want to withdraw this amount of money from your account?") if (answer){ form.submit(); } else{ return false; } } }); How to solve this problem?

    Read the article

  • Method of getting text on a windows form ( unmanaged C++ project )

    - by Donovan
    I'm in the process of learning C++. I've created a boilerplate Win32 app within VC++ 2008. I've studied through the code and am ready do do a bit of experimenting. I thought it would be cool to print all the windows messages received in the message loop to the form created via the boilerplate code. I for the life of me, can't figure out the method of getting text onto that form. I can't seem to identify and named object that I can use to reference that damn form. The best I can figure is I need to use the handle to reference the form somehow. Still, even if I did know how to reference the form, I'm not sure I know how I would create a label to display the text. Anyway, if someone could just point out what methodology I need to learn to make this happen it would be much appreciated. Thanks, Donovan

    Read the article

  • Django: Extending User Model - Inline User fields in UserProfile

    - by Jack Sparrow
    Is there a way to display User fields under a form that adds/edits a UserProfile model? I am extending default Django User model like this: class UserProfile(models.Model): user = models.OneToOneField(User, unique=True) about = models.TextField(blank=True) I know that it is possible to make a: class UserProfileInlineAdmin(admin.TabularInline): and then inline this in User ModelAdmin but I want to achieve the opposite effect, something like inverse inlining, displaying the fields of the model pointed by the OneToOne Relationship (User) in the page of the model defining the relationship (UserProfile). I don't care if it would be in the admin or in a custom view/template. I just need to know how to achieve this. I've been struggling with ModelForms and Formsets, I know the answer is somewhere there, but my little experience in Django doesn't allow me to come up with the solution yet. A little example would be really helpful!

    Read the article

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