Search Results

Search found 22501 results on 901 pages for 'form upload'.

Page 3/901 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • how to check if the enddate is after the startdate in a zend form

    - by murze
    I have a zend form with a start- and an endate. $form = new Zend_Form(); $form->setName($this->formName) ->setMethod('post'); $feStartdate = new Zend_Form_Element_Text('startdate'); $feEnddate = new Zend_Form_Element_Text('enddate'); $form->addElement($feStartDate) ->addElement($feEndDate) ->addElement('submit', 'submit', array('label' => 'Save')); I assume I must write a custom validator for to check this. How would this custom validator look like and how can I call it? I assume something like $feEnddate->addValidator('dateComesAfter', $feStartDate)

    Read the article

  • Zend_Form : Adding fields in sub-forms on user's click

    - by anu iyer
    I'm having a zend form - comprised of a number of zend - sub forms, where the user is creating a new question (its a content management system). In one of the subforms, the user can click on a button to add more textfields, like this: [----------] [----------] [click to add more] which should give [----------] [----------] [----------] [click to add more] I'm trying to set a flag in the sub form in question - or set a count on how many times the button has been clicked, to add that many total fields to the subform - but its simply not working. I tried using a static count variable - but the value doesnt get incremented at all. Any thoughts on how to do this in a Zend-subform within a zend form? I'll definitely update if I hit a solution. Thanks!

    Read the article

  • Form Validation Options

    The steps involved in transmitting form data from the client to the Web server User loads web form. User enters data in to web form fields User clicks submit On submit page validates fields using JavaScript. If validation errors are found then the validation script stops the browser from canceling posting the data to the web server and displays error messages as needed. If the form passes the data validation process then the browser will URL encode the values of every field and post it to the server.  The server reads the posted data from the query string and then again validates the data just to ensure data consistency and to prevent any non-validated data because JavaScript was turned off on the clients browser from being inserted in to a database or passed on to other process. If the data passes the second validation check then the server side code will continue with the requested processes. In my opinion, it is mandatory to validate data using client side and server side validation as a fail over process. The client side validation allows users to correct any error before they are sent to the web server for processing, and this allows for an immediate response back to the user regarding data that is not correct or in the proper format that is desired. In addition, this prevents unnecessary interaction between the user and the web server and will free up the server over time compared to doing only server side validation. Server validation is the last line of defense when it comes to validation because you can check to ensure the user’s data is correct before it is used in a business process or stored to a database. Honestly, I cannot foresee a scenario where I would only want to use one form of validation over another especially with the current cost of creating and maintaining data. In my opinion, the redundant validation is well worth the overhead.

    Read the article

  • Upload file using jquery dialog not working

    - by kandroid
    i want to upload file using jquery dialog. I have created a partial view and showing that partial view in the dialog. The problem is, when I directly browse the partial view and upload a file, it works perfect. BUT when I put the partial view inside a jquery dialog, it submits the form, but don't submits the file. So i have null value. I really dont understand what is the difference here!! Hope someone can help me to identify the problem. here is some codes; jquery codes: $('#UploadDialog').dialog({ autoOpen: false, width: 580, resizable: false, modal: true, open: function (event, ui) { $(this).load('@Url.Action("Upload","Notes")'); }, buttons: { "Upload": function () { $("#upload-message").html(''); $("#noteUploadForm").submit(); }, "Cancel": function () { $(this).dialog("close"); } } }); $(".uploadLink").click(function () { $('#UploadDialog').dialog('open'); }); return false; }); partial view: @using (Ajax.BeginForm("Upload", "Notes", null, new AjaxOptions { UpdateTargetId = "upload-message", InsertionMode = InsertionMode.Replace, HttpMethod = "POST", OnSuccess = "uploadSuccess" }, new { id = "noteUploadForm" , enctype="multipart/form-data"})) { <div> <div id="upload-message"></div> <div class="editLabel"> @Html.LabelFor(m => m.Notes.NoteTitle) </div> <div class="editText"> @Html.TextBoxFor(m => m.Notes.NoteTitle) </div> <div class="clear"></div> <div class="editLabel"> @Html.Label("Upload file") </div> <div class="editText"> <input type="file" name="file" />(100MB max size) </div> </div> }

    Read the article

  • Bypass django form validation on new form instance

    - by Thomas Schultz
    Hello! I have a situation where we are trying to autofill some form data on the second page of a signup and I was wondering if there's a way to bypass the entire form validation when we pass in only a couple of fields? so we have something like form = NewForm(request.POST) Where request.POST only contains some of the fields in NewForm(). So the page loads and there is feedback about how some fields are not filled in yet. This all happens from the GET request of the second page. Is there a way to do something like... form = NewForm(request.POST, validate=False)

    Read the article

  • how to submit a form without loosing values already selected at the same form

    - by kawtousse
    Hi everyone, I am using jstl with dropdown lists. When i click submit button i success the specification but values int dropdownlists are reinitialized. So I want to submit form without loosing the values already selected in the form because I need to stay always at the same level in the form.To be more clear, user choose a value from ddl and click edit button to show other options and fill them at the same form without loosing what he has selected. I have tried to deal like that: but it doesn't work. think you for your help.

    Read the article

  • Passing variables to a Custom Zend Form Element

    - by user322003
    Hi, I'm trying to create a custom form element which extends Zend_Form_Element_Text with a validator (so I don't have to keep setting up the validator when I use certain elements). Anyway, I'm having trouble passing $maxChars variable to it when I instantiate it in my Main form. I've provided my shortened code below This is my custom element below class My_Form_Custom_Element extends Zend_Form_Element_Text { public $maxChars public function init() { $this->addValidator('StringLength', true, array(0, $this->maxChars)) } public function setProperties($maxChars) { $this->maxChars= $maxChars; } } This is where I instantiate my custom form element. class My_Form_Abc extends Zend_Form { public function __construct($options = null) { parent::__construct($options); $this->setName('abc'); $customElement = new My_Form_Custom_Element('myCustomElement'); $customElement->setProperties(100); //**<----This is where i set the $maxChars** $submit = new Zend_Form_Element_Submit('submit'); $submit -> setAttrib('id', 'submitbutton'); $this->addElements(array($customElement ,$submit)); } } When I try to pass '100' using $customElement-setProperties(100) in my Form, it doesnt get passed properly to my StringLength validator. I assume it's because the validator is getting called in Init? How can I fix this?

    Read the article

  • Display small form while main form is "locked"

    - by daemonsvk
    Hi there, i'm thinking about writing a WPF program that would require login and password at the app startup. I thought about small form with two textboxes as a login form. User will have to fill in his details and then the main form of the application will be unlocked. How will you solve this? Thanks for your answers, daemonsvk

    Read the article

  • Creating form object for variable kind of form.

    - by Bunny Rabbit
    i want to create a form for users to submit questions in django ..so far the models i have created are class Question(models.Model): statement=models.CharField(max_length=100) class Choice(models.Model): statement=models.CharField(max_length=100) value=models.IntegerField() question=models.ForeignKey(Question) Now i want to write a Form class for creating a above form but the problem is the number of choices are variable,a user can decide how many choices a question must have .How do i do that in django?

    Read the article

  • Handling form from different view and passing form validation through session in django

    - by Mo J. Mughrabi
    I have a requirement here to build a comment-like app in my django project, the app has a view to receive a submitted form process it and return the errors to where ever it came from. I finally managed to get it to work, but I have doubt for the way am using it might be wrong since am passing the entire validated form in the session. below is the code comment/templatetags/comment.py @register.inclusion_tag('comment/form.html', takes_context=True) def comment_form(context, model, object_id, next): """ comment_form() is responsible for rendering the comment form """ # clear sessions from variable incase it was found content_type = ContentType.objects.get_for_model(model) try: request = context['request'] if request.session.get('comment_form', False): form = CommentForm(request.session['comment_form']) form.fields['content_type'].initial = 15 form.fields['object_id'].initial = 2 form.fields['next'].initial = next else: form = CommentForm(initial={ 'content_type' : content_type.id, 'object_id' : object_id, 'next' : next }) except Exception as e: logging.error(str(e)) form = None return { 'form' : form } comment/view.py def save_comment(request): """ save_comment: """ if request.method == 'POST': # clear sessions from variable incase it was found if request.session.get('comment_form', False): del request.session['comment_form'] form = CommentForm(request.POST) if form.is_valid(): obj = form.save(commit=False) if request.user.is_authenticated(): obj.created_by = request.user obj.save() messages.info(request, _('Your comment has been posted.')) return redirect(form.data.get('next')) else: request.session['comment_form'] = request.POST return redirect(form.data.get('next')) else: raise Http404 the usage is by loading the template tag and firing {% comment_form article article.id article.get_absolute_url %} my doubt is if am doing the correct approach or not by passing the validated form to the session. Would that be a problem? security risk? performance issues? Please advise Update In response to Pol question. The reason why I went with this approach is because comment form is handled in a separate app. In my scenario, I render objects such as article and all I do is invoke the templatetag to render the form. What would be an alternative approach for my case? You also shared with me the django comment app, which am aware of but the client am working with requires a lot of complex work to be done in the comment app thats why am working on a new one.

    Read the article

  • Upload files with HTTPWebrequest (multipart/form-data)

    - by dr. evil
    Is there any class, library or some piece of code which will help me to upload files with HTTPWebrequest? Edit 2: I do not want to upload to a WebDAV folder or something like that. I want to simulate a browser, so just like you upload your avatar to a forum or upload a file via form in a web application. Upload to a form which uses a multipart/form-data. Edit: WebClient is not cover my requirements, so I'm looking for a solution with HTTPWebrequest.

    Read the article

  • CSS Hidden DIV Form Submit

    - by Michael
    Using CSS, when a link is clicked it brings up a hidden DIV that contains a form. The user will then enter information and then submit the form. I'd like the hidden DIV to remain visisble, and a 'success message' to be displayed after submission. Then the user will have the option of closing the DIV. I can't get it to work without reloading the page, which causes the DIV to become hidden again. Any ideas? <body> <a href="javascript:showDiv()" style="color: #fff;">Click Me</a> <!--POPUP--> <div id="hideshow" style="visibility:hidden;"> <div id="fade"></div> <div class="popup_block"> <div class="popup"> <a href="javascript:hideDiv()"> <img src="images/icon_close.png" class="cntrl" title="Close" /> </a> <h3>Remove Camper</h3> <form method="post" onsubmit="email.php"> <p><input name="Name" type="text" /></p> <p><input name="Submit" type="submit" value="submit" /></p> </form> <div id="status" style="display:none;">success</div> </div> </div> </div> <!--END POPUP--> <script language=javascript type='text/javascript'> function hideDiv() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('hideshow').style.visibility = 'hidden'; } else { if (document.layers) { // Netscape 4 document.hideshow.visibility = 'hidden'; } else { // IE 4 document.all.hideshow.style.visibility = 'hidden'; } } } function showDiv() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('hideshow').style.visibility = 'visible'; } else { if (document.layers) { // Netscape 4 document.hideshow.visibility = 'visible'; } else { // IE 4 document.all.hideshow.style.visibility = 'visible'; } } } </script> </body>

    Read the article

  • Upload Image with Django Model Form

    - by jmitchel3
    I'm having difficulty uploading the following model with model form. I can upload fine in the admin but that's not all that useful for a project that limits admin access. #Models.py class Profile(models.Model): name = models.CharField(max_length=128) user = models.ForeignKey(User) profile_pic = models.ImageField(upload_to='img/profile/%Y/%m/') #views.py def create_profile(request): try: profile = Profile.objects.get(user=request.user) except: pass form = CreateProfileForm(request.POST or None, instance=profile) if form.is_valid(): new = form.save(commit=False) new.user = request.user new.save() return render_to_response('profile.html', locals(), context_instance=RequestContext(request)) #Profile.html <form enctype="multipart/form-data" method="post">{% csrf_token %} <tr><td>{{ form.as_p }}</td></tr> <tr><td><button type="submit" class="btn">Submit</button></td></tr> </form> Note: All the other data in the form saves perfectly well, the photo does not upload at all. Thank you for your help!

    Read the article

  • Form graphics not set when form loads

    - by Jimmy
    My form has a group box which contains two overlapping rectangles. The form's other controls are two sets of four numeric up down controls to set the rectangles' colors. (nudF1,2,3 and 4 set the rectangle that's in front, and nudB1,2,3 and 4 set the rectangle that's behind.) Everything works fine, except that the rectangles do not display the colors set in the numeric up downs when the form first loads. The numeric up down controls' ChangeValue events all call the ShowColors() method. The form's Load event calls the csColorsForm_Load() method. Any suggestions? namespace csColors { public partial class csColorsForm : Form { public csColorsForm() { InitializeComponent(); } private void csColorsForm_Load(object sender, EventArgs e) { this.BackColor = System.Drawing.Color.DarkBlue; SetColors(sender, e); } private void SetColors(object sender, EventArgs e) { Control control = (Control)sender; String ctrlName = control.Name; Graphics objGraphics; Rectangle rect1, rect2; int colorBack, colorFore; objGraphics = this.grpColor.CreateGraphics(); // If calling control is not a forecolor control, paint backcolor rectangle if (ctrlName.Substring(0,4)!="nudF") { colorBack = int.Parse(SetColorsB("nudB"), NumberStyles.HexNumber); SolidBrush BrushB = new SolidBrush(Color.FromArgb(colorBack)); rect1 = new Rectangle(this.grpColor.Left, this.grpColor.Top, this.grpColor.Width, this.grpColor.Height); objGraphics.FillRectangle(BrushB, rect1); } // Always paint forecolor rectangle colorFore = int.Parse(SetColorsB("nudF"), NumberStyles.HexNumber); SolidBrush BrushF = new SolidBrush(Color.FromArgb(colorFore)); rect2 = new Rectangle(this.grpColor.Left, this.grpColor.Top, this.grpColor.Width, this.grpColor.Height); objGraphics.FillRectangle(BrushF, rect2); objGraphics.Dispose(); } private string SetColorsB(string nam) { string txt=""; for (int n = 1; n <= 4; ++n) { var ud = Controls[nam + n] as NumericUpDown; int hex = (int)ud.Value; txt += hex.ToString("X2"); } return txt; } private void btnClose_Click(object sender, EventArgs e) { this.Close(); } } }

    Read the article

  • Problem retrieving values from Zend_Form_SubForms - no values returned

    - by anu iyer
    I have a Zend_Form that has 4 or more subforms. /** Code Snippet **/ $bigForm = new Zend_Form(); $littleForm1 = new Form_LittleForm1(); $littleForm1->setMethod('post'); $littleForm2 = new Form_LittleForm2(); $littleForm2->setMethod('post'); $bigForm->addSubForm($littleForm1,'littleForm1',0); $bigForm->addSubForm($littleForm2,'littleForm2',0); On clicking the 'submit' button, I'm trying to print out the values entered into the forms, like so: /** Code snippet, currently not validating, just printing **/ if($this-_request-getPost()){ $formData = array(); foreach($bigForm->getSubForms() as $subForm){ $formData = array_merge($formData, $subForm->getValues()); } /* Testing */ echo "<pre>"; print_r($formData); echo "</pre>"; } The end result is that - all the elements in the form do get printed, but the values entered before posting the form don't get printed. Any thoughts are appreciated...I have run around circles working on this! Thanks in advance!

    Read the article

  • adding Form Validation Javacript of jquery???

    - by user634599
    How can I add inline Validation to make sure a choice of radio input must be selected <script type="text/javascript"> function choosePage() { if(document.getElementById('weightloss').form1_option1.checked) { window.location.replace( "http://google.com/" ); } if(document.getElementById('weightloss').form1_option2.checked) { window.location.replace( "http://yahoo.com/" ); } } </script> <form id="weightloss"> <input type="radio" id="form1_option1" name="weight-loss" value="5_day" class="plan"> <label for="form1_option1"> 5 Day - All Inclusive Price</label><br> <input type="radio" id="form1_option2" name="weight-loss" value="7_day"> <label for="form1_option2"> 7 Day - All Inclusive Price</label><br> <input type="button" value="Place Order" alt="Submit button" class="orange_btn" onclick="choosePage()"> </form>

    Read the article

  • get renamed file names of multiple upload form [js array] in codeigniter

    - by artmania
    Hi friends, I use codeigniter. I have a multiple image upload form. The code below is working well for uploading, but I also need to save file names to database. How can I get the names in here? I spent hours & hours :/ but could not sort it :/ Appreciate helps!!! uploadform.php echo form_open_multipart('gallery/upload'); <input type="file" name="photo" size="50" /> <input type="file" name="thumb" size="50" /> <input type="submit" value="Upload" /> </form> I have a controller between form view and model load model (of course : )) but didnt post here because of no need. gallery_model.php function multiple_upload($upload_dir = 'uploads/', $config = array()) { /* Upload */ $CI =& get_instance(); $files = array(); if(empty($config)) { $config['upload_path'] = realpath($upload_dir); $config['allowed_types'] = 'gif|jpg|jpeg|jpe|png'; $config['max_size'] = '2048'; } $CI->load->library('upload', $config); $errors = FALSE; foreach($_FILES as $key => $value) { if( ! empty($value['name'])) { if( ! $CI->upload->do_upload($key)) { $data['upload_message'] = $CI->upload->display_errors(ERR_OPEN, ERR_CLOSE); // ERR_OPEN and ERR_CLOSE are error delimiters defined in a config file $CI->load->vars($data); $errors = TRUE; } else { // Build a file array from all uploaded files $files[] = $CI->upload->data(); } } } // There was errors, we have to delete the uploaded files if($errors) { foreach($files as $key => $file) { @unlink($file['full_path']); } } elseif(empty($files) AND empty($data['upload_message'])) { $CI->lang->load('upload'); $data['upload_message'] = ERR_OPEN.$CI->lang->line('upload_no_file_selected').ERR_CLOSE; $CI->load->vars($data); } else { return $files; } /* ------------------------------- Insert to database */ // problem is here, i need file names to add db. // if there is already same names file at the folder, it rename file itself. so in such case, I need renamed file name :/ } }

    Read the article

  • Wordpress: Upload has failed to upload due to an error Missing a temporary folder

    - by JL.
    I've installed Wordpress on IIS, Running on Windows 7 (64Bit). Rest of the site is working perfectly. Except when I try upload images into media. I then get this error message "sample.jpg" has failed to upload due to an error Missing a temporary folder I have edited the php.ini file to point to a directory : D:\work\websites\mySite Saved that and done an IIS reset. Problem still persists. Any ideas what is wrong?

    Read the article

  • Cannot upload files bigger than 8GB to Amazon S3 by multi-part upload due to broken pipe

    - by spencerho
    I implemented S3 multi-part upload, both high level and low level version, based on the sample code from http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?HLuploadFileJava.html and http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?llJavaUploadFile.html When I uploaded files of size less than 4 GB, the upload processes completed without any problem. When I uploaded a file of size 13 GB, the code started to show IO exception, broken pipes. After retries, it still failed. Here is the way to repeat the scenario. Take 1.1.7.1 release, create a new bucket in US standard region create a large EC2 instance as the client to upload file create a file of 13GB in size on the EC2 instance. run the sample code on either one of the high-level or low-level API S3 documentation pages from the EC2 instance test either one of the three part size: default part size (5 MB) or set the part size to 100,000,000 or 200,000,000 bytes. So far the problem shows up consistently. I attached here a tcpdump file for you to compare. In there, the host on the S3 side kept resetting the socket.

    Read the article

  • Problems with image/file upload in MediaWiki on Windows 2008 Server R2, using wrong temp directory

    - by Lasse V. Karlsen
    I have installed MediaWiki 1.15.2 under IIS as per the MediaWiki installation instructions for Windows 2008 Server. I have configured PHP to use a specific temp directory: upload_tmp_dir="C:\php\uploadtemp" I have specified that MediaWiki is allowed to upload: $wgEnableUploads = true; But when I try to upload an image, I get this error message in my browser: Internal error Could not find file "C:\Windows\Temp\php1AEA.tmp". Retrying will simply give me a new filename, but in the same location. The directory does not have any php* files in it, but since they're "temporary", they might be gone in a flash before Windows Explorer is able to show them so that might be a red herring. I've googled for this, and the most promising lead I found was on this page: Image upload problem - Is this bug fixed?, but since the text says "a bugfix was posted on the bug-report page", but provides no link to which bug page this relates to (php or mediawiki) nor the actual bug report, I've not found conclusively the bug report in question so that didn't help me much. Lots of pages indicates that this is a permission issue, so I tried setting permissions on c:\windows\temp as Modify by Everyone, still no dice. I tried changing the two system environment variables TEMP and TMP to point to C:\Temp instead, but MediaWiki still complains about not finding the file in C:\Windows\Temp. Note that I don't care a lot about where the files will actually be stored temporarily, so c:\windows\temp is fine by me. I do, however, care about them actually being uploaded correctly. Does anyone know of a fix, have any leads I can follow, or whatnot? The server is running Windows 2008 Server R2, all patches installed, and the PHP installed is 5.3.2, using IIS FastCGI.

    Read the article

  • Measure Upload Speed between a client and our server

    - by tresstylez
    We host a SAAS application specially customized for multiple clients. For one customer in particular -- they are reporting sporadic performance issues from various locations on their network, in particular UPLOADING documents through a form on our website. The client claims they have "bandwidth to spare" and that utilization of their "pipe" is so low that it MUST be our application, but our application has MANY clients and all features are working fine for all other clients. Interestingly enough -- DOWNLOADS (ie. just accessing the website, or downloading documents) is working fine. Speed test shows that they should get 1.2Mbps UP. So, a 3MB file should take 20 secs to upload. It takes 60+ seconds on their network. Sometimes even small files take OVER 10 minutes to upload or they timeout. Pings and Traceroutes don't show any abnormally long hops or response times. They claim other SAAS applications they use allow them to upload just fine. Both IT teams are working together to resolve this issue. What kind of data can I request from the clients to begin ruling things out. Seems like we need to somehow measure LATENCY of the networks involved or even at the switch level, we need to understand if packets are getting dropped somewhere and why. Where should I start? Any help is appreciated. I'll provide more info upon requests

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >