Search Results

Search found 7702 results on 309 pages for 'django validation'.

Page 64/309 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • JQuery Validation using Remote posts empty data to webservice

    - by user319721
    I'm using the JQuery Validation plugin. I'm using the remote option to make a call to my webservice to check if a company name exists. The webservice only accepts JSON data. I pass the data to the webservice from the Company Input Field in my Form as follows: data: "{'company': '" + $('#Company').val() + "'}" But this always returns a blank value for company so the response is {'company':''} i.e. correct JSON but missing the Company Input Field value. Can anyone shed some light on why I always get a blank value here? Thanks for the help, Ciaran

    Read the article

  • "Dynamic" java validation framework?

    - by pihentagy
    AFAIK JSR-303 is the standard bean validation system. I don't know whether it could do validations like this (I guess no): if an object has a deleted flag set, you cannot modify the object you cannot change the start date property, after the date is passed you cannot decrease some integer properties in the bean So how can I handle validations, which depend on the previous state of an object? I would like to solve problems like that in hibernate3.5 - spring3 - JPA2 environment. Thanks My solution was to mess with hibernate, reload the object to see the old state (after evicting the new object). This time I need some smarter solution...

    Read the article

  • jQuery Validation - Highlighting Radio Labels

    - by Michael
    I'm trying to use jQuery validation to highlight the labels for my radio buttons only, and not the labels for my other inputs. I have a label for my radio button set called 'type'. I can't seem to get it to work! $(document).ready(function(){ $("#healthForm").validate({ highlight: function(element, errorClass) { $(element).addClass(errorClass) $(element.form).find("label[for='type']") .addClass("radioerror"); }, unhighlight: function(element, errorClass) { $(element).removeClass(errorClass) $(element.form).find("label[for='type']") .removeClass("radioerror"); }, errorPlacement: function(error, element) { } }); });

    Read the article

  • spring mvc nested model validation

    - by hguser
    I have two models : User,Project public class Project{ private int id; @NotEmpty(message="Project Name can not be empty") private String name; private User manager; private User operator; //getter/setter omitted } public class User{ private int id; private String name; //omit other properties and getter/setter } Now, when I create a new Project, I will submit the following parameters to ProjectController: projects?name=jhon&manager.id=1&operator.id=2... Then I will create a new Project object and insert it to db. However I have to validate the id of the manager and operator is valid,that's to say I will validate that if there is matched id in the user table. So I want to know how to implement this kind of validation?

    Read the article

  • Laravel: validation for unique username issue

    - by T2theC
    I have a noodle scratcher that I can't seem to figure out. I am validating for unique usernames and emails addresses. I have the following rules: protected $rules = array( 'username' => 'required|min:4|unique:users,username', 'email' => 'email|unique:users,email', 'password' => 'min:6', ); If I update a form that has the username (which is the same as it currently is), I get a The username has already been taken. error. If I do the same with the email, I get no error at all. I know about adding the last param to the unique validation: 'unique:users,username,{{$id}}' or 'unique:users,username,'.$id This doesn't work on the username. I get the same issue. I can't figure out why this works for the email, but not the username. Anyone had a similar issue or know where I am going wrong? Many thanks,

    Read the article

  • Context dependent validation

    - by Ole Lynge
    I would like to be able to validate an object in different contexts using DataAnnotations in .NET 4. For example: If I have a class with these annotated properties [Required] public string Name { get; set; } [Required] public string PhoneNumber { get; set; } [Required] public string Address { get; set; } I would like to be able to do something like bool namePhoneValid = Validator.TryValidateObject(entity, contextNamePhone, results1); bool allValid = Validator.TryValidateObject(entity, contextAll, results2); where contextNamePhone only validates Name and Phone, and contextAll validates all properties (Name, Phone and Address in this case). Is this possible? How should the validation context be constructed? Are there other/smarter ways to do this?

    Read the article

  • script validation error

    - by Kyle Sevenoaks
    Hi, there is a script in my html tag <script type="text/javascript"> function setTaxDisplay(display) { window.location.href += (window.location.href.indexOf('?') > -1 ? '&' : '?') + 'taxInclude=' + display; } </script> When passed to validation It returns that the ampersand there isn't valid, but it's absolutely vital to the function of the page, is there a way I can make the validator ignore this? I don't need to validate the page, I'm no JS expert at all I'm not sure if I can replace it with &amp;. Thanks.

    Read the article

  • Validation file upload CakePHP

    - by kicaj
    How validate file upload in CakePHP? When i wrote some like this:var $validate = array( 'file' => array( 'select' => array( 'rule' => array('selectFile', false), 'message' => 'There is no file!'), 'type' => array( 'rule' => array('typeFile'), 'message' => 'Bad type!'), 'size' => array( 'rule' => array('sizeFile'), 'message' => 'Bad with size!'))); Works only with the last validate, here 'size'. Maybe You know solution, for validation for files with many messages?

    Read the article

  • Displaying form validation errors in a template (Symfony)

    - by Jay
    Hi, let's say I have a blog with a module "post". now I display a post like this: post/index?id=1 in the index-action i generate a new CommentForm and pass it as $this-form to the template and it is being displayed at the bottom of a post (it's just a textfield, nothing special). form action is set to "post/addcomment". How can I display the validation errors in this form? using setTemplate('index') doesn't work because I would have to pass the id=1 to it... thanks

    Read the article

  • Symfony: Pre filtering submitted values before/after validation

    - by Rob
    Hi All I've been scouring the net and i have found nothing! I am using symfonys form framework to build a simple 'Create' form. Validation is fine. However i'd like to pre-filter my submitted values, so adding ucfirst, strtoupper, and the like. I'm not sure if im missing something crucial here, but the way i see it is the only way to do this would be to create my own custom validators and utilizing the doClean method, which seems daft since i'd have hundreds of validators for each php function! Hope you guys can help, i've been crawling through source code, api's, numerous books and blogs and i haven't found a thing :( Either it's impossible, or it's really easy, i hope its the latter!

    Read the article

  • Custom Rails Validation (Doesn't seem to be working)

    - by Karl Entwistle
    Hey guys ive got the following Model for Accounts require 'net/http' require 'uri' require 'date' class Account < ActiveRecord::Base validates_presence_of :username, :password, :on => :update validate :valid_expiry_date, :on => :update def valid_expiry_date reply = Net::HTTP.get URI.parse("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login=" + username + "&password=" + password) account = Time.at(reply[80..90].to_i) if (Time.now + 2419200) <= account return true else return false errors.add_to_base("Sorry this account isnt valid") end end end I know the code works in a ruby.rb file and will return true or false, however I seem to be having rather a lot of difficultly trying to translate this code into an actual validation, any help would be much appreciated. Thanks :) Its also defiantly at least connecting to the website as my firewall asked me if the Terminal was aloud to access it. At the moment not only is it displaying no errors its actually letting anything through and saving it.

    Read the article

  • Jquery Validation Central Message Many Errors

    - by Iamjon
    Hi everyone, I have a form that is being valdated with the Jquery Validation Plugin. I have managed to get a centeral message "Please Recheck the form", and to have the input focus on the first error. To get this, I had to override the default message of each of the errors. I was wondering if anyone could help me figure out how I can have it display the error message associated with the first error input instead of a general error message. Here is the code: $("#Help-A-Noobie-Form" ).validate({ invalidHandler: function(form, validator) { $(this).find(":input.error:first").focus(); var message = 'Please Recheck The Form' ; $("#Help-A-Noobie-Form #Message p").addClass('red').html(message); }, showErrors: function(errorMap, errorList) { this.defaultShowErrors(); }, rules: { required:true, email: {email:true}, phone: {digits:true} }, messages: { email: "", phone: "", lastname: "", firstname: "", required:"" } })

    Read the article

  • custom error message using (bassistance.de form validation)

    - by Abu Hamzah
    How can I add a custom error message to my .aspx. Is there a way to make it template for other pages to use? Here is how my .aspx page looks like: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="validation.aspx.cs" Inherits="Web.validation" %> <br> < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br> < html xmlns="http://www.w3.org/1999/xhtml" > <br> < head id="Head1" runat="server"><br> <title>Untitled Page</title><br> < /head><br> < body><br> < form id="form1" runat="server"><br> < div><br> < li><br> < label id="lblFirstName" for="FirstName"><br> First Name : < /label> < input id="FirstName" name="FirstName" type="text" maxlength="25" class="required" /><em><img src="images/required.png" alt="required" /></em> </li> <li><br> < label id="lbllastName" for="LastName"><br> Last Name : < /label><br> < input id="LastName" name="LastName" type="text" maxlength="25" class="required" /><em><img src="images/required.png" alt="required" /></em> </li><br> <li><br> < label id="lblAddr1" for="Addr1"> Address : < /label><br> <input id="Addr1" name="Addr1" type="text" maxlength="25" /> </li> <li> <label id="lblAddr2" for="Addr2"> Address 2 : </label> <input id="Addr2" name="Addr2" type="text" maxlength="25" /> </li> <li> <label id="lblZip" for="txtZip"> Zip : </label> <input id="txtZip" name="txtZip" type="text" class="ZipCodeMask" /> </li> <li> <label id="lblCity" for="City"> City : </label> <input id="City" name="City" type="text" maxlength="25" /> </li> <li> <label id="lblState" for="State"> State : </label> <input id="txtState" name="txtState" type="text" maxlength="25" /> </li> <li> <label id="lblPhone" for="txtPhone"> Phone : </label> <input id="txtPhone" type="text" name="txtPhone" class="phone PhoneMask" /> </li> <li> <label id="lblEmail" for="EMail"> E-Mail : </label> <input id="EMail" name="EMail" type="text" maxlength="100" class="required email" /><em><img src="images/required.png" alt="required" /></em> </li> <li> <label id="lblComment" for="Comment"> Comment or Question : </label> <textarea id="Comment" name="Comment" cols="40" rows="6" class="required"></textarea><em> <img src="images/required.png" alt="required" /></em> </li> <li> <ul> <li> <button id="btnCancel" name="btnCancel" type="button"> Cancel</button></li> <li> <button id="btnReset" name="btnReset" type="reset"> Reset</button></li> <li> <button id="btnSubmit" name="btnSubmit" type="submit"> Submit</button></li> </ul> </li> </div> </form> <script src="js/jquery.validate.min.js" type="text/javascript"></script> </body> </html>

    Read the article

  • ASP.NET MVC 2 Model object validation

    - by Jimmy
    Hey guys, I'm trying to validate a model object outside of the context of ModelState within a controller, I currently have a parser that creates model objects from an excel file and I want to be able to report how many entries were added to the database and how many failed, is there a way to validate a model object on its data annotations outside of model binding? I'm looking for something similar to the rails model method of model.valid? or a way for me to implement that myself. My current solution is just manually checking if a few key fields are present but this duplicates requirements between my model class and its metadata, there has to be a better way to hook into the model validation checking that is done by mvc 2. Thanks

    Read the article

  • regular expression for validation not working

    - by Camran
    I have a "description textarea" inside a form where user may enter a description for an item. This is validated with javascript before the form beeing submitted. One of the validation-steps is this: else if (!fld.value.match(desExp)){ And desExp: var desExp = /^\s*(\w[^\w]*){3}.*$/gm; Now my problem, this works fine on all cases except for descriptions where the description BEGINS with a special character of the swedish language (å, ä, ö). This wont work: åäö hello world But this will: hello world åäö Any fixes? Thanks

    Read the article

  • django image upload forms

    - by gramware
    I am having problems with django forms and image uploads. I have googled, read the documentations and even questions ere, but cant figure out the issue. Here are my files my models class UserProfile(User): """user with app settings. """ DESIGNATION_CHOICES=( ('ADM', 'Administrator'), ('OFF', 'Club Official'), ('MEM', 'Ordinary Member'), ) onames = models.CharField(max_length=30, blank=True) phoneNumber = models.CharField(max_length=15) regNo = models.CharField(max_length=15) designation = models.CharField(max_length=3,choices=DESIGNATION_CHOICES) image = models.ImageField(max_length=100,upload_to='photos/%Y/%m/%d', blank=True, null=True) course = models.CharField(max_length=30, blank=True, null=True) timezone = models.CharField(max_length=50, default='Africa/Nairobi') smsCom = models.BooleanField() mailCom = models.BooleanField() fbCom = models.BooleanField() objects = UserManager() #def __unicode__(self): # return '%s %s ' % (User.Username, User.is_staff) def get_absolute_url(self): return u'%s%s/%s' % (settings.MEDIA_URL, settings.ATTACHMENT_FOLDER, self.id) def get_download_url(self): return u'%s%s/%s' % (settings.MEDIA_URL, settings.ATTACHMENT_FOLDER, self.name) ... class reports(models.Model): repID = models.AutoField(primary_key=True) repSubject = models.CharField(max_length=100) repRecepients = models.ManyToManyField(UserProfile) repPoster = models.ForeignKey(UserProfile,related_name='repposter') repDescription = models.TextField() repPubAccess = models.BooleanField() repDate = models.DateField() report = models.FileField(max_length=200,upload_to='files/%Y/%m/%d' ) deleted = models.BooleanField() def __unicode__(self): return u'%s ' % (self.repSubject) my forms from django import forms from django.http import HttpResponse from cms.models import * from django.contrib.sessions.models import Session from django.forms.extras.widgets import SelectDateWidget class UserProfileForm(forms.ModelForm): class Meta: model= UserProfile exclude = ('designation','password','is_staff', 'is_active','is_superuser','last_login','date_joined','user_permissions','groups') ... class reportsForm(forms.ModelForm): repPoster = forms.ModelChoiceField(queryset=UserProfile.objects.all(), widget=forms.HiddenInput()) repDescription = forms.CharField(widget=forms.Textarea(attrs={'cols':'50', 'rows':'5'}),label='Enter Report Description here') repDate = forms.DateField(widget=SelectDateWidget()) class Meta: model = reports exclude = ('deleted') my views @login_required def reports_media(request): user = UserProfile.objects.get(pk=request.session['_auth_user_id']) if request.user.is_staff== True: repmedform = reportsForm(request.POST, request.FILES) if repmedform.is_valid(): repmedform.save() repmedform = reportsForm(initial = {'repPoster':user.id,}) else: repmedform = reportsForm(initial = {'repPoster':user.id,}) return render_to_response('staffrepmedia.html', {'repfrm':repmedform, 'rep_media': reports.objects.all()}) else: return render_to_response('reports_&_media.html', {'rep_media': reports.objects.all()}) ... @login_required def settingchng(request): user = UserProfile.objects.get(pk=request.session['_auth_user_id']) form = UserProfileForm(instance = user) if request.method == 'POST': form = UserProfileForm(request.POST, request.FILES, instance = user) if form.is_valid(): form.save() return HttpResponseRedirect('/settings/') else: form = UserProfileForm(instance = user) if request.user.is_staff== True: return render_to_response('staffsettingschange.html', {'form': form}) else: return render_to_response('settingschange.html', {'form': form}) ... @login_required def useradd(request): if request.method == 'POST': form = UserAddForm(request.POST,request.FILES ) if form.is_valid(): password = request.POST['password'] request.POST['password'] = set_password(password) form.save() else: form = UserAddForm() return render_to_response('staffadduser.html', {'form':form}) Example of my templates {% if form.errors %} <ol> {% for field in form %} <H3 class="title"> <p class="error"> {% if field.errors %}<li>{{ field.errors|striptags }}</li>{% endif %}</p> </H3> {% endfor %} </ol> {% endif %} <form method="post" id="form" action="" enctype="multipart/form-data" class="infotabs accfrm"> {{ repfrm.as_p }} <input type="submit" value="Submit" /> </form>

    Read the article

  • ASP.NET MVC validation problem

    - by ile
    ArticleRepostitory.cs: using System; using System.Collections.Generic; using System.Linq; using System.Web; using CMS.Model; using System.Web.Mvc; namespace CMS.Models { public class ArticleDisplay { public ArticleDisplay() { } public int CategoryID { set; get; } public string CategoryTitle { set; get; } public int ArticleID { set; get; } public string ArticleTitle { set; get; } public DateTime ArticleDate; public string ArticleContent { set; get; } } public class ArticleRepository { private DB db = new DB(); // // Query Methods public IQueryable<ArticleDisplay> FindAllArticles() { var result = from category in db.ArticleCategories join article in db.Articles on category.CategoryID equals article.CategoryID select new ArticleDisplay { CategoryID = category.CategoryID, CategoryTitle = category.Title, ArticleID = article.ArticleID, ArticleTitle = article.Title, ArticleDate = article.Date, ArticleContent = article.Content }; return result; } public IQueryable<ArticleDisplay> FindTodayArticles() { var result = from category in db.ArticleCategories join article in db.Articles on category.CategoryID equals article.CategoryID where article.Date == DateTime.Today select new ArticleDisplay { CategoryID = category.CategoryID, CategoryTitle = category.Title, ArticleID = article.ArticleID, ArticleTitle = article.Title, ArticleDate = article.Date, ArticleContent = article.Content }; return result; } public Article GetArticle(int id) { return db.Articles.SingleOrDefault(d => d.ArticleID == id); } public IQueryable<ArticleDisplay> DetailsArticle(int id) { var result = from category in db.ArticleCategories join article in db.Articles on category.CategoryID equals article.CategoryID where id == article.ArticleID select new ArticleDisplay { CategoryID = category.CategoryID, CategoryTitle = category.Title, ArticleID = article.ArticleID, ArticleTitle = article.Title, ArticleDate = article.Date, ArticleContent = article.Content }; return result; } // // Insert/Delete Methods public void Add(Article article) { db.Articles.InsertOnSubmit(article); } public void Delete(Article article) { db.Articles.DeleteOnSubmit(article); } // // Persistence public void Save() { db.SubmitChanges(); } } } ArticleController.cs: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Mvc.Ajax; using CMS.Models; using CMS.Model; namespace CMS.Controllers { public class ArticleController : Controller { ArticleRepository articleRepository = new ArticleRepository(); ArticleCategoryRepository articleCategoryRepository = new ArticleCategoryRepository(); // // GET: /Article/ public ActionResult Index() { var allArticles = articleRepository.FindAllArticles().ToList(); return View(allArticles); } // // GET: /Article/Details/5 public ActionResult Details(int id) { var article = articleRepository.DetailsArticle(id).Single(); if (article == null) return View("NotFound"); return View(article); } // // GET: /Article/Create public ActionResult Create() { ViewData["categories"] = new SelectList ( articleCategoryRepository.FindAllCategories().ToList(), "CategoryId", "Title" ); Article article = new Article() { Date = DateTime.Now, CategoryID = 1 }; return View(article); } // // POST: /Article/Create [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(Article article) { if (ModelState.IsValid) { try { // TODO: Add insert logic here articleRepository.Add(article); articleRepository.Save(); return RedirectToAction("Index"); } catch { return View(article); } } else { return View(article); } } // // GET: /Article/Edit/5 public ActionResult Edit(int id) { ViewData["categories"] = new SelectList ( articleCategoryRepository.FindAllCategories().ToList(), "CategoryId", "Title" ); var article = articleRepository.GetArticle(id); return View(article); } // // POST: /Article/Edit/5 [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(int id, FormCollection collection) { Article article = articleRepository.GetArticle(id); try { // TODO: Add update logic here UpdateModel(article, collection.ToValueProvider()); articleRepository.Save(); return RedirectToAction("Details", new { id = article.ArticleID }); } catch { return View(article); } } // // HTTP GET: /Article/Delete/1 public ActionResult Delete(int id) { Article article = articleRepository.GetArticle(id); if (article == null) return View("NotFound"); else return View(article); } // // HTTP POST: /Article/Delete/1 [AcceptVerbs(HttpVerbs.Post)] public ActionResult Delete(int id, string confirmButton) { Article article = articleRepository.GetArticle(id); if (article == null) return View("NotFound"); articleRepository.Delete(article); articleRepository.Save(); return View("Deleted"); } } } View/Article/Create.aspx: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CMS.Model.Article>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Create </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Create</h2> <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %> <% using (Html.BeginForm()) {%> <fieldset> <legend>Fields</legend> <p> <label for="Title">Title:</label> <%= Html.TextBox("Title") %> <%= Html.ValidationMessage("Title", "*") %> </p> <p> <label for="Content">Content:</label> <%= Html.TextArea("Content", new { id = "Content" })%> <%= Html.ValidationMessage("Content", "*")%> </p> <p> <label for="Date">Date:</label> <%= Html.TextBox("Date") %> <%= Html.ValidationMessage("Date", "*") %> </p> <p> <label for="CategoryID">Category:</label> <%= Html.DropDownList("CategoryId", (IEnumerable<SelectListItem>)ViewData["categories"])%> </p> <p> <input type="submit" value="Create" /> </p> </fieldset> <% } %> <div> <%=Html.ActionLink("Back to List", "Index") %> </div> </asp:Content> If I remove DropDownList from .aspx file then validation (on date only because no other validation exists) works, but of course I can't create new article because one value is missing. If I leave dropdownlist and try to insert wrong date I get following error: System.InvalidOperationException: The ViewData item with the key 'CategoryId' is of type 'System.Int32' but needs to be of type 'IEnumerable'. If I enter correct date than the article is properly inserted. There's one other thing that's confusing me... For example, if I try manually add the categoyID: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(Article article) { if (ModelState.IsValid) { try { // TODO: Add insert logic here // Manually add category value article.CategoryID = 1; articleRepository.Add(article); articleRepository.Save(); return RedirectToAction("Index"); } catch { return View(article); } } else { return View(article); } } ..I also get the above error. There's one other thing I noticed. If I add partial class Article, when returning to articleRepository.cs I get error that 'Article' is an ambiguous reference between 'CMS.Models.Article' and 'CMS.Model.Article' Any thoughts on this one?

    Read the article

  • Installation requirements of django installing in hostgator dedicated server

    - by jaypabs
    First, before I install OSQA on my dedicated server at hostgator, I want to know the requirements. I don't want to screw up my server so it's better to ask question first. I have read a lot of tutorial on the internet regarding Django but I want to clarify something before I proceed. On my dedicated server I don't use FCGI. Instead I use Mod SuPHP. A lot of tutorial is talking about installing python using FCGI. My question is if it is safe to install Python if I'm using SuPHP? Is it safe to use the tutorial on this link: http://wiki.osqa.net/display/docs/Installing+OSQA+on+CentOS6?focusedCommentId=4784144 Thanks in advance for your help.

    Read the article

  • CentOS 6.5 as WebServer for Django Dev

    - by Charlesliam
    During CentOS 6.5 Installation I choose WebServer type for this computer. The server has a static IP address 192.168.111.100. The CentOS was updated I managed to install virtualenv with Python 2.7. Within the virtualenv, I'll be using Django Framework. After I tried to run the command using root user python manage.py runserver 0.0.0.0:8000 I can't see the website from other computer within the LAN when I try to type 192.168.111.100:8000/admin on my browser. I already disable firewall using service iptables stop I can ping the 192.168.111.100 and I have a good feedback with nslookup. What seems the problem of my config?

    Read the article

  • django + wsgi + suexec + userdir + apache?

    - by Jayen
    I've got a django 1.1 website I want to run in wsgi (as that seems to be the recommended deployment on apache). I want it to run as the www user (apache is running as www-data). I would ideally like this to work out of http://hostname/~www/ (~www/public_html) as well as http://virtualhostname/. I also want this to work for other users who may later use wsgi. Can I make this happen? I've been staring at docs trying to figure where to start, but I'm having trouble combining userdir and wsgi to let me run ~xxx/public_html/index.wsgi as user xxx, for every user xxx.

    Read the article

  • asp.net form validation. Server-side or client-side

    - by Jeroen
    Here's (i think) an interesting question. With AJAX more and more common i feel more and more like doing all form validation server-side. Picture a registration form pre-AJAX. You have all your validation client-side using the common asp validation controls and validation summery...except...checking username availability, check emailadress availability, captcha and what not. So you end up with 2 kinds of validation and so presenting the user with 2 different UI's at 2 different moments. 2 words come to my mind. Ugly. Inconsistent. So here's the question. Why not do all the validation server-side (using AJAX or not). (I'm not using JQuery yet, should i?)

    Read the article

  • Different settings for secure & non-secure versions of Django site using WSGI

    - by Jordan Reiter
    I have a Django website where some of the URLs need to be served over HTTPS and some over a normal connection. It's running on Apache and using WSGI. Here's the config: <VirtualHost example.org:80> ServerName example.org DocumentRoot /var/www/html/mysite WSGIDaemonProcess mysite WSGIProcessGroup mysite WSGIScriptAlias / /path/to/mysite/conferencemanager.wsgi </VirtualHost> <VirtualHost *:443> ServerName example.org DocumentRoot /var/www/html/mysite WSGIProcessGroup mysite SSLEngine on SSLCertificateFile /etc/httpd/certs/aace.org.crt SSLCertificateKeyFile /etc/httpd/certs/aace.org.key SSLCertificateChainFile /etc/httpd/certs/gd_bundle.crt WSGIScriptAlias / /path/to/mysite/conferencemanager_secure.wsgi </VirtualHost> When I restart the server, the first site that gets called -- https or http -- appears to select which WSGI script alias gets used. I just need a few settings to be different for the secure server, which is why I'm using a different WSGI script. Alternatively, it there's a way to change settings in the settings.py file based on whether the connection is secure or not, that would also work. Thanks

    Read the article

  • idle proccesses and high memory bad? uwsgi/django

    - by JimJimThe3rd
    I have a VPS with 256MB of ram. I'm running nginx, uwsgi and postgresql on Ubuntu 12.04 for a soon to be Django site. About 200MB of ram are being used despite the website not being active, the uwsgi processes seem to just be idling. Is this bad? I once heard that having a bunch of free memory isn't necessarily a good metric because it is possible that the memory in use can easily be freed up. I mean, it is possible that the server is storing commonly used "stuff" in case it is accessed but is more than happy to dump it if the ram is needed. But I'm really not sure, hence me asking this question. If it is bad I could set some of the application loading options for uwsgi like "cheap" or "idle" mode. Screenshot of my htop

    Read the article

  • django fcgi - call a management command with subprocess.Popen

    - by user41855
    Hi, I'm using an app called django-chronograph. It has a code of line which works in my dev environment and does not work in production: p = subprocess.Popen(['python', get_manage_py(), 'run_job', str(self.pk)]) This line crashes in production with: unknown command run_job Whereas when I run directly from command line: manage.py run_job It works fine. Interestingly it worked once when we exchanged 'python' with 'usr/bin/python'. then we restarted the server once more and it was back to old behaviour. Thus it seems as we have a python path issue. I'm not the guy who is running the server, its my app that should run and it would be great to get some help here. Attention: I'm a total noob regarding server-administration.. server environment: NGINX with FCGI-Daemon FCGI in prefork-mode

    Read the article

  • Using jQuery validation plugin with tabbed navigation

    - by user3438917
    I have a tabbed navigation wizard, for which the first section needs to be validated before proceeding to the next tab. The validation should trigger when the user hits the "next" button. I am unable to get the validation to trigger though: <form id="target-group" novalidate="novalidate"> <div class="box"> <div class='box-header-main'><h2><img src="assets/img/list.png" /> Target Group Information</h2></div> <br /> <div class='box'> <div class='box-header-property'><h2><span data-bind="text:Name">New Target Group</span> | <i class='fa fa-file'></i></h2></div> <br /> <div class='row'> <div id='flight-wizard'> <div id='content' class='col-lg-12'> <div class='col-lg-12'> <div id='tabs'> <ul> <li id="targetgroup-info-tab"><a href='#tabs-1'><i class="fa fa-info-circle"></i>Target Group Info</a></li> <li id="zone-tab"><a href='#tabs-2'><i class="fa fa-map-marker"></i>Zones</a></li> </ul> <div id='tabs-1'> <div class='row'> <div class='col-xs-6'> <div class='form-group'> Name<sup>*</sup> <input id="selectError0" name="name" class='form-control col-xs-12' data-bind="value: asdf" placeholder='Enter Name ...' /> </div> <form class='form-horizontal'> <div class='form-group'> Product(s)<sup>*</sup> <div class='controls' id='products'> <select id='selectError3' class='form-control' data-bind="options:test, optionsText: 'Name', optionsValue : 'test', value: test, optionsCaption: 'Choose Product...'"></select> </div> </div> </form> </div> <!--RIGHT PANE--> <div class='col-xs-6'> <div class='form-group'> Platform<sup>*</sup> <div class='controls'> <select id="selectError2" class='form-control' data-bind="options:test, optionsText: 'Name', optionsValue: 'test', value : test, optionsCaption: 'Choose Platform...'"></select> </div> </div> <form class='form-horizontal'> <div class='form-group'> AdTypes(s)<sup>*</sup> <div class='controls' id='adtypes'> <select multiple="" id='adtypesselect' class='form-control' data-rel="chosen" data-bind="options:test, optionsText: 'Name', optionsValue : 'test', selectedOptions: test, optionsCaption: 'test...'"></select> </div> </div> </form> <button id="btn_cancel_large" class='btn btn-large btn-primary btn-round'><i class='fa fa-ban' /></i> Cancel</button> <button id="btn-next-large" class='btn btn-large btn-primary btn-round'>Next <i class='fa fa-arrow-circle-right'></i></button> </div> <!--end of right pane--> </div> </div> <div id='tabs-2'> <div class='row'> <div class='col-lg-12'> <div class='row'> <div class='col-lg-12'> <div id='zones_list' class='box-content'> <div id='add-new-targetgroupzone' class='add-new'><i class='fa fa-plus-circle'></i><a href='/#/inventory/targeting/' onclick="return false;">Add Zone</a></div> <table id="results" width="100%"> <thead> <tr> <th>Publisher</th> <th>Property</th> <th>Zone</th> <th>AdTypes</th> <th width='10%'>Quick&nbsp;Actions</th> </tr> </thead> </table> </div> </div> </div> </div> </div> <br /> <div class="btn_row"> <button id="btn_cancel_large2" class='btn btn-large btn-primary btn-round'><i class='fa fa-ban' /></i> Cancel</button> <button id="btn-submit-large" class='btn btn-large btn-primary btn-round'>Submit <i class='fa fa-arrow-circle-down'></i></button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </form> <form id="zones-form" style="display: none;" novalidate="novalidate" class="slideup-form"> <div class="box"> <div class="box-header-panel"> <h2>Add Target Group Zone</h2> <div class="box-icon" id="zones-form-close"> <i class="fa fa-arrow-circle-down"></i> </div> </div> <div class="box-content clearfix"> <div class="box-content"> <table id="zones-list" width="100%"> <thead> <tr> <th>Publisher</th> <th>Property</th> <th>Zone</th> <th>AdTypes</th> <th width='10%'>Quick&nbsp;Actions</th> </tr> </thead> </table> </div> </div> </div> </div> </form> jQuery: $("#target-group").validate({ rules: { name: { required: true } }, messages: { name: "Name required", } }); $('#btn-next-large').click(function () { if ($('#target-group').valid()) $tabs.tabs('select', $(this).attr("rel")); });

    Read the article

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