JQuery :: Customized Message For Validate - It Works In Chrome But Not IE
Mar 29, 2011The following code doesn't work with customized CSS.
AddClass('Message'). It works in Chrome but not IE.
[code].....
The following code doesn't work with customized CSS.
AddClass('Message'). It works in Chrome but not IE.
[code].....
Ok so I'm not very familiar with Jquery as to know the possible cause of this, but I've been assigned to find out why the datepicker doesn't work porperly on a client's computer (it prints out the date without slashes like this: 24112008
So when I test the webform, I see it doesnt even pop up in Firefox (the client's browser too) nor chrome, only in IE8.
In the scriptManager we have:
<script src="http://www.website.com/Script/jquery.min.js" type="text/javascript"></script>
<script src="http://www.website.com/Script/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://www.website.com/Script/jquery-ui-i18n.min.js" type="text/javascript"></script>
and in the webform:
$(function pageLoad(sender, args) {
// Datepicker
$.datepicker.setDefaults($.extend({ showMonthAfterYear: false }, $.datepicker.regional['']));
$(".dates").datepicker($.datepicker.regional['es']);
});
The textbox that uses it goes like this:
<asp:TextBox ID="txtFeNac" CssClass="dates" style="margin-left: 7px" runat="server" ></asp:TextBox>
I am having an issue where i have fields on a form that contains an update panel that i want to do Jquery validation on. The issue is when i click the OK button, the validation error message appears then goes away. the code is below:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Project Management System</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.js"></script>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.js"></script>......
How to validate a group then render a single error message?
Below returns error message on each field.
[code]....
I would like to know how to use jQuery's Validate plugin to add rules to validate controls in ASCX custom user control?
View 4 RepliesI have an ASP.NET page that updates customer profile information.
After updating and when the user clicks on Update button, i want to display alert message.
Can we customize it to edit the MsgBox title?
Can we edit the default msg that is displaying? If yes, Can anybody provide any samples.
I earlier used customized popup from AjaxToolkit. I have issues with that in IE6.0. So I don't want to go for that.
I have the following situation I am having trouble with.
1) Users select some items from a checkbox & type a message in a textbox
2) The user clicks on a message preview button
3) Based on what they had selected, a message will be created. This message is stored in a database
4) I am using showModalDialog to display their message to the user.
5) The user is given two options, send & cancel
**Here is where the problem starts**
6) If the user clicks send, I want to call a server side method that sends this message to a portal (method already developed) I was trying to use "__doPostBack....", but this is throwing a javascript error.
I've created a new website using forms authentication. Everything works fine on my local DEV machine - I can log in with no problem in any browser.
But as soon as I deploy this to my production server, I am unable to login using IE. I get to the login page and when I click to login, it just reloads that page and never authenticates me. If I use Google Chrome, I can log in without any problems.
I know this sounds similar to the common problem where you don't have your applicationName specified in the web.config file, but I have that specified in all of my providers.
I've tried this in both IE8 and IE9 while adjusting the cookie settings to accept everything and it makes no difference. I've also tried on multiple computers.
Since I can get it to work in Chrome, I feel like there must be a setting in the code somewhere that affects IE differently. I have a hard time believing it's a setting in IE because I use the standard, default setup there.
The only way I could get this close to working was to adjust this forms authentication setting: cookieless = "UseUri". When I did this, I could get past the login screen to my default page, but then when I tried to navigate to any other pages, it would always take me back to the login page and make me login again. It would take me to the requested page each time, but I would still have to login again at every new page request.
Here are a couple of snippets from my web.config file.
<authentication mode="Forms">
<forms loginUrl="Login.aspx"
path="/"
protection="All"
[Code]....
I have .net code that works on IE8 but wont work on google chrome or firefox. i have put this code for the user to press Enter instead of clicking the mouse everytime.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
If Not IsPostBack Then
[code]...
I've created code to retrieve an image from the file system using an ASHX handler. The code displays the image correctly in Chrome, but I get a broken image in IE:
[Code]....
I am giving external css path in aspx page via
<link rel="stylesheet" media="all" href="file:///D:/CSS/Style.css" type="text/css" />
its works fine in firefox and ie while access that page.
but when i open this page in chrome or safari.
it does'nt do anything and no css is applying.
The following regular expression works in chrome and firefox, but not IE7:
^((?=.*d)(?=.*[a-z])(?=.*[A-Z]).{8,20})$
It needs to contain at least 8 characters and have at least on uppercase and a number. When I try this in IE7, I have to type 14 characters for it to validate. Can someone explain why and what would be the correct expression for all 3 browsers.
I am using an asp:RegularExpressionValidator to validate the password.
The following flash does not initially load in firefox, but if I click the second tab on the right, and then go back to the first, it loads. This works in Chrome and IE. Here is the webpage.
View 3 RepliesI have the following asp.net markup:
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password"
ValidationGroup="passwordValidation"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic"
ControlToValidate="txtPassword" Text="Required" ValidationGroup="passwordValidation" />
<asp:RegularExpressionValidator runat="server" ControlToValidate="txtPassword"
Text="Passwords should contain a minimum of 7 characters with at least one numeric
character." ValidationExpression="^(?=.*d{1})(?=.*[a-zA-Z]{2}).{7,}$"
ValidationGroup="passwordValidation" Display="Dynamic"></asp:RegularExpressionValidator>
If I type in a password like test1234, it passes in chrome and firefox, but the message that my password should contain a minimum of 7 characters with at least one numeric character is shown in internet explorer
Just like in title. It works much faster on IE (8, 9) than on firefox and chrome ?How is it possible ?
Whats more I had to disable cookies on aspxGridViews because I had bad requests all the time,
I have a situation that is need of attention.The following code is inside of a .ashx file, and is used in the Uploadify JQuery Script.(Here is a sample of the working IE/non-working FF,Chrome code)http://ee.cffcs.com/Q_Uploadify/1.zipThis file is never seen, it is only used behind.In IE you can upload images when you are logged in.In FF and Chrome you can only upload images when you are logged in with IE.(That is not right is it?)So, what is wrong, I know that the cookie script is functioning properly within the .ashx file, as I have test with another JQuery page and it works across all browsers, but when I use the cookie code in this, it acts wierd in FF and Chrome.Please someone enlighten me on this issue.What is going on with the cookie with Uploadify.
[Code]....
I have strange problem with the membership provider on my mvc application.
I have a webforms page inside admin folder which calls the following code in the models directory.
public int SaveUploadedFile(HttpPostedFileBase fileBase)
SiteMap is not clickable on Firefox,Chrome and Safari But works perfecly fine on IE..Here is the code;
div.logintext {
position: relative;
top: 25%;
display: table-cell;
vertical-align: middle;
text-align: left;
[code]...
I have VS 2008 installed and have IE8 browser as well as google chrome browser.However wheneever i try to run a .aspx page in solution explorer of VS with the browse with.. options,the page runs fine with chrome browser but not with IE8.The IE browser shows the error "Ineternet explorer cannot display the page".I have set the IE as the default browser in the browse with ... option of the VS 2008.
View 6 RepliesI'm making a website in ASP.NET 4.0 where I make use of the RequiredFieldValidator control to validate a wizardstep.It works perfectly with Javascript enabled, but when I turn it off (in my Firefox) it just goes to the next step.We don't do a Page.IsValid check, but we don't do much on the "next button clicked" event either.Certainly not something that is forcing it to go to the next step.
View 15 RepliesValidation summary is giving me problem when using Google Chrome. On all pages of my Website it truncates the error message at the end, For example it shows:
enter your N...
Invalid Em...
I'm using a slightly modified version of Valum's upload [github link], I've modified it to upload to a database but haven't modified the javascript that it is using to get the file into the Request as an InputStream. The following line of code is failing in IE 8 but is confirmed to work in Chrome. using (Image imgInput = Image.FromStream(Request.InputStream)) The error received is "Parameter not valid". It appears to be having an issue with the Input Stream being used but it exists/has data (not sure how to validate if the data is good or not).
Page
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Upload-Pictures</h2>
<div id="file-uploader">
<noscript>
<p>Please enable JavaScript to use file uploader.</p>
</noscript>
</div>
<script src="/Scripts/fileuploader.js" type="text/javascript"></script>
<script type="text/javascript">
function createUploader() {
var uploader = new qq.FileUploader({
element: document.getElementById('file-uploader'),
action: '/Admin/FileUpload/' + <%= Model.PropertyId %>,
debug: true
});
}
window.onload = createUploader;
</script>
</asp:Content>
Controller
[AcceptVerbs(HttpVerbs.Post)]
public JsonResult FileUpload(int id)
{
try
{
byte[] newImageByteArray = GetByteArrayForResizedImage(350, Request.InputStream);
byte[] thumbnailByteArray = GetByteArrayForResizedImage(150, Request.InputStream);
//Add to DB
}
catch (Exception ex)
{
// This is where the exception is caught
return Json(new { success = false, message = ex.Message }, "application/json");
}
return Json(new { success = true }, "application/json");
}
private static byte[] GetByteArrayForResizedImage(int imageSize, Stream inputStream)
{
byte[] imageByteArray;
// For some reason in IE the inputStream here is causing it to crash
using (Image imgInput = Image.FromStream(inputStream))
{
//Image processing
}
return imageByteArray;
}
fileuploader.js - qq.FileUploader
/**
* Class that creates upload widget with drag-and-drop and file list
* @inherits qq.FileUploaderBasic
*/
qq.FileUploader = function(o){
// call parent constructor
qq.FileUploaderBasic.apply(this, arguments);
// additional options
qq.extend(this._options, {
element: null,
// if set, will be used instead of qq-upload-list in template
listElement: null,
template: '<div class="qq-uploader">' +
'<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>' +
'<div class="qq-upload-button">Upload a file</div>' +
'<ul class="qq-upload-list"></ul>' +
'</div>',
// template for one item in file list
fileTemplate: '<li>' +
'<span class="qq-upload-file"></span>' +
'<span class="qq-upload-spinner"></span>' +
'<span class="qq-upload-size"></span>' +
'<a class="qq-upload-cancel" href="#">Cancel</a>' +
'<span class="qq-upload-failed-text">Failed</span>' +
'</li>',
classes: {
// used to get elements from templates
button: 'qq-upload-button',
drop: 'qq-upload-drop-area',
dropActive: 'qq-upload-drop-area-active',
list: 'qq-upload-list',
file: 'qq-upload-file',
spinner: 'qq-upload-spinner',
size: 'qq-upload-size',
cancel: 'qq-upload-cancel',
// added to list item when upload completes
// used in css to hide progress spinner
success: 'qq-upload-success',
fail: 'qq-upload-fail'
}
});
// overwrite options with user supplied
qq.extend(this._options, o);
this._element = this._options.element;
this._element.innerHTML = this._options.template;
this._listElement = this._options.listElement || this._find(this._element, 'list');
this._classes = this._options.classes;
this._button = this._createUploadButton(this._find(this._element, 'button'));
this._bindCancelEvent();
this._setupDragDrop();
};
fileuploader.js - qq.FileUploaderBasic
/**
* Creates upload button, validates upload, but doesn't create file list or dd.
*/
qq.FileUploaderBasic = function(o){
this._options = {
// set to true to see the server response
debug: false,
action: '/server/upload',
params: {},
button: null,
multiple: true,
maxConnections: 3,
// validation
allowedExtensions: [],
sizeLimit: 0,
minSizeLimit: 0,
// events
// return false to cancel submit
onSubmit: function(id, fileName){},
onProgress: function(id, fileName, loaded, total){},
onComplete: function(id, fileName, responseJSON){},
onCancel: function(id, fileName){},
// messages
messages: {
typeError: "{file} has invalid extension. Only {extensions} are allowed.",
sizeError: "{file} is too large, maximum file size is {sizeLimit}.",
minSizeError: "{file} is too small, minimum file size is {minSizeLimit}.",
emptyError: "{file} is empty, please select files again without it.",
onLeave: "The files are being uploaded, if you leave now the upload will be cancelled."
},
showMessage: function(message){
alert(message);
}
};
qq.extend(this._options, o);
// number of files being uploaded
this._filesInProgress = 0;
this._handler = this._createUploadHandler();
if (this._options.button){
this._button = this._createUploadButton(this._options.button);
}
this._preventLeaveInProgress();
};
I'm trying out the jQuery Validation plugin jQuery Docs Here is the markup of my form:
<% using (Html.BeginForm("action", "contoller", null, FormMethod.Post, new { id = "sxform" })){%>
<div id="manifest">
Manifest Option:<br />
<%= Html.DropDownList("docid", ViewData["manifests"] as SelectList, new { @class = "required" })%>
</div>
<div id="release">
Release Version:<br />
<%= Html.TextBox("release", null, new { @class = "required" })%>
</div>
<div id="locale">
Localization:<br />
<%= Html.DropDownList("localization", ViewData["localizations"] as SelectList, new { @class = "required" })%>
</div>
<div id="label">
Label:<br />
<%= Html.TextBox("label", null, new { @class = "required" })%>
</div>
<div id="session">
Session ID (optional):<br />
<%= Html.TextBox("sessionInput", null, new { @class = "required" })%>
</div>
<div id="submit"><input type="submit" value="Build" /></div>
<% } %>
JS:
$(document).ready(function(){
$("#sxform").validate();
});
I am using MS MVC HTML Helpers to render this form. The resulting markup looks fine. IE each input and selection element contains the attribute 'class' with the value 'required'. When I submit this form the validation does noting.
I have a textbox, with a RequiredFieldValidator and a ValidatorCalloutExtender. The calloutExtender comes up when there is no text in the textbox, but it does not display the error message from the RequiredFieldValidator. I tested this code in a test app, and it worked. It may have something to do with the content containers? These controls are inside of a web user control, which are inside a Telerik RadDock. The parent page also uses a MasterPage. Here is my code from the usercontrol which contains the validator:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="WebApplication1.UserControls.WebUserControl1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
[code]...
I placed 2 requiredfieldvalidators in my page (well, actually, more like a dozen of them, but only these 2 behave this way) and can not seem to figure out why the error message will not be displayed. The validation function works (the processing code is not run and focus is returned to the first field that fails validation) but no error message.
[Code]....