JQuery :: Basic Regulaer Expressions Fails?

May 24, 2010

I'm trying to replace a ^ if the user types it in. This works ..

[Code]...

View 2 Replies


ADVERTISEMENT

JQuery :: Basic Ajax Request Fails On IE 8

Mar 22, 2010

i have a very simple ajax request, on Chrome and FF, IE 8 it works very well. IE 8 returns "error", "complete"

the content /test.php :

<div>test</div>

Ajax request:

$(document).ready(function()
{
$('#test').click(function(){
$.ajax({

[Code].....

View 4 Replies View Related

JQuery :: Replacing Content With Regular Expressions?

Feb 21, 2011

I have a string content which include the content "[some number]". I wanted to replace the inner number which is inside the square bracket with jQuery regular expressions. the number inside the brackets are always variables.

View 3 Replies View Related

JQuery :: Validation Plugin - Regular Expressions Or Condition?

Mar 7, 2011

I´ve problem with Validation plugin... I´ve one select like this..

[Code]...

Next problem is with the right phone number format.. I have a PHP regular expression, but I don´t know how to insert this regExp into JS.

View 7 Replies View Related

JQuery :: Basic FadeIn Not Working?

Dec 6, 2009

I'm about to embark on really learning jQuery. The first step of which is to get a basic jquery function to work. Everytime I learn something this way the first thing does not work for no apparent reason. It's probably something obvious but I can't move on without getting this to work. I added jquery to the page I have two things a div called #content-container and an image with class .logo

[Code]....

View 1 Replies View Related

JQuery :: Get A Basic Datepicker To Open Up

Jan 4, 2011

My shopping cart is using jQuery UI 1.7.2

I added jQuery UI Datepicker 1.8.7

I'm including jquery.ui.datepicker.css and jquery.ui.all.css versions 1.8.7 in my header, when I click the input box firebug shows the datepicker code is in the source but the ui-helper-hidden-accessible class isn't being removed to display the datepicker. Do I need to update jquery or at least ui.core which is 1.7.2?

After playing with the css files I was able to get the datepicker to open but the prev and next text is being displayed above the prev/next buttons

I've tried every combination I could with these files to get a basic datepicker to open up

View 1 Replies View Related

JQuery :: Getting The Most Basic Statement Working?

Mar 8, 2011

I've got the following code block in one of my pages ...

<?php
if ($config->theme->short_name == 'default')
{
?>
<script type="text/javascript">

[Code]...

Shouldn't the code above set the .html property of the element with class "error_box" to the specified text? I've tried using an id instead of a class i.e. $('#error_box").html(...) but that doesn't work either. I've also tried using the .text() method.

Manually using document.getElementById("error_box") works without any problems - it's only jQuery that won't do what I tell it. :-)

View 2 Replies View Related

Jquery :: Basic Fade With Image?

Sep 10, 2009

When i add this simple function. i am not able to fade the image back n forth.

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

[code]....

View 3 Replies View Related

IE5 And Look Ahead Expressions

May 10, 2005

I am using a JS form validator that uses the following regex to test whether a string contains at least one unsigned int and one letter.

var reAlphanumeric = /^(?=.*[0-9]+.*)(?=.*[a-zA-Z]+.*)([0-9a-zA-Z])+$/;

function checkAlphaNum( theField ) {
if ( isWhitespace( theField.value ) || !reAlphanumeric.test( theField.value ) ) {
return false;
} else {
return true;
}}

Since IE5 doesn't support look ahead expressions, I am using the following function to get the same result in IE5.

var reUnsignedInteger = /^[+]?[0-9]+$/;
var reAlphabetic = /^[a-zA-Z]+$/;

function IE_AlphaNum( s ) {
var isInt = false;
var isLet = false;
var isOp = false;
var len;
var setStr = strArray( s );

for ( var i = 0; i < setStr.length; i++ ) {
if ( reAlphabetic.test( setStr[i] ) ) {
isLet = true;
break;
}
}

for ( var i = 0; i < setStr.length; i++ ) {
if ( reUnsignedInteger.test( setStr[i] ) ) {
isInt = true;
break;
}
}

for ( var i = 0; i < setStr.length; i++ ) {
if ( !reAlphabetic.test( setStr[i] ) && !reUnsignedInteger.test( setStr[i] ) ) {
isOp = true;
break;
}
}

if ( isInt && isLet && !isOp )
return true;
else
return false;
}

Can a regex be used that will satisify the one int/one letter rule that will work in IE5 or if not, can the above function be refactored w/o having to interate through the string array each time? Neither method works in Opera 6. Also, is there any condition except for validating perhaps a password where such a rule would be needed?

View 1 Replies View Related

JQuery :: Basic Function Won't Work In IE 8 Or Lower?

Jan 11, 2012

check out the Social Media "more" button dropdown at:[URL]

It's supposed to grown in size, and then fade the icons up.

In IE, it grows but then does nothing.

The jQuery code:

<script type="text/javascript">
jQuery( function(){
$grown = 0;
jQuery("#more-social").click(function() {

[Code]....

View 1 Replies View Related

JQuery :: InnerHeight Fails In Ie

Dec 12, 2011

Im trying to make a sticky footer and it works fine in all fo the browsers except ie, it wont add the needed height, when using height() it works but if i use innerHeight() it wont work, heres the code

[Code]...

View 2 Replies View Related

JQuery :: PreventDefault() Fails In IE8?

Apr 7, 2010

jquery-1.4.2.min.js

I'm trying to use the Alt+keyCode in my web-app and want to prevent the event from bubbling up to the browser.

The following works fine in FF & Chrome, no event propagation, but fails in IE8:

$().ready(function() {
$('html').keydown(function(event) {
if (event.altKey) {
if (event.altKey && event.keyCode == 83) { // 'S'

[Code].....

View 3 Replies View Related

Regular Expressions Challenge

Jul 23, 2005

Coding patterns for regular expressions is completely unintuitive, as far
as I can see. I have been trying to write script that produces an array
of attribute components within an HTML element.

Consider the example of the HTML element TABLE with the following
attributes producing sufficient complexity within the element:

<table id="machines" class="noborders inred"
style="margin:2em 4em;background-color:#ddd;">

Note that the HTML was created as a string in code, and thus there are NO
newlines ('
') in the string, as if a file was parsed...so newlines are
not an issue. The only whitespace is the space character ' ' itself,
required to delimit the element components.

I want to write an RE containing paranthesized substring matching that
neatly orders attribute components. The resulting array, after the
execution of the string .match() method upon the example, should look as
follows:

attrs = [ "id", "machines", "class", "noborders inred", "style",
"margin:2em 4em;background-color:#ddd;" ]

I can then march down the array (in steps of 2) setting attributes
(name=value) to the element using standard DOM interface methods, right?

In approaching the writing of the RE, I have to take into account the
characters permitted to form the attribute name and the attribute value.

I assume a start to the RE pattern as:

<attribute name>=<attribute value>

I then try to find the right RE pattern for <attribute name>, keeping in
mind what the legal characters are for attribute names according to the
HTML standard ("recommendation"):

[A-Za-z0-9-]+

I believe this patterns conforms to the standard for attribute values:

[,;'":!%A-Za-z0-9s.-]+

That pattern tries to be more exclusive than inclusive, although I think
just about every character on the planet, including a newline, is
acceptable in an attribute value, at least the kind one might see in an
HTML document. Code:

View 7 Replies View Related

Regular Expressions For Username

May 24, 2007

I am trying to construct a reg exp for a field which can accept username as
(username) or (username@domain.com/net/org etc).

username should allowed alphanumeric values also it should accept -,_,.
it should not allowed @ twice

View 2 Replies View Related

Simple Regular Expressions

Jul 5, 2004

I'm having a problem making the regular expression for U.S. zip code verification work.
the regular expression: /(^d{5}$)|(^d{5}-d{4}$)/

My code is below. No matter what I type in, it asks me to correct my zip code. Any suggestions? Code:

View 2 Replies View Related

Regular Expressions In JavaScript

Jun 3, 2001

I am trying to use regular expressions within JavaScript for the picture upload component of a shopping cart. I still can't seem to get my mind around them.

I have a page with a working file upload. When you click on browse and then select your file, the file name is also returned to the second field, the picture name field. The problem is that the entire string is returned - 'G:CatalogMyPicturessomepic.jpg' instead of 'somepic.jpg'.

I know this can be pulled out with regular expressions, everything from the right until it hits a / or I included the script and a couple of links. Code:

View 3 Replies View Related

JQuery :: Basic Show/Hide, But Only 1 Item At A Time?

May 18, 2009

I have a table of data, and I would like these options to show up when that <td> is hovered over, but as you can see this hides/shows every <td>.

$('div.msgEdit').hover(function() {
$('td .msgEdit a').show();
},

[code]....

View 2 Replies View Related

JQuery :: Get Rid Of The Slide Effect On A Basic Horizontal Menu?

Jun 30, 2009

How can I get rid of the slide effect on a basic horizontal menu? I love the way the "basic" example works but I can't mimic it without having the text all slide to right and re-sizing the box.

View 2 Replies View Related

JQuery :: Create A Basic A Accordian Style Menu?

May 17, 2011

I am trying to create a basic a accordian style menu. Im guessing i have done 90% of the code, but a little stuck now.I have three widget and what I am attempting to do is hide all the widgets apart from the one actually clicked. My code so far is as follows.

$(".widget-title").click(
function () {
$("#widget1_content").hide(); //My Widgets
$("#widget2_content").hide();

[code]...

View 2 Replies View Related

JQuery :: Code OK In Firefox But Fails In IE

Feb 17, 2010

I have what I thought was a simple piece of code to count characters in a text area. The code works fine in FF and safari, but not in IE. Can someone explain if the problem is my code or something else.

View 3 Replies View Related

JQuery :: Adding Basic Animation - Allows To Create Pages And Navigate Between Them

Mar 26, 2010

I have been playing with a bit of code I found of the web and it works well, it basicly allows me to create pages and navigate between them all done via JQuery. The one question I have is, how hard is it to add some simple animation to it, such as fadein which if I have read correctly is built into JQuery?

code below:

View 3 Replies View Related

Regular Expressions To Perform Validations?

May 6, 2010

know there is a similar post on here but it didn't really give me any actual help on this topic:It seems that I have the correct regular expressions in this however it doesn't want to follow my freaking instructions can you guys maybe show me where I'm going wrong and give me a short source code on how to rectify it. Code is below:

function validate(theForm)
{
var falseCounter = 0;

[code]....

View 7 Replies View Related

Form Validation Using Regular Expressions?

May 3, 2010

I'm trying to validate the form, but each time I try to do so, all fields return invalid. I've tested my regular expressions with various online testers and they seem to work fine, am I perhaps using it in the wrong way? Or maybe a problem with my functions?

[Code]...

View 4 Replies View Related

Form Verification Using Regular Expressions?

Mar 4, 2011

i'm trying to use a regular expression to verify an order. I basically don't want any decimals or negative numbers allowed. I believe I have any digit 0-9 one or more times and negating decimals. but for some reason it allows decimals and letters. also is it correct to put return true or can i just leave it blank?

var varifyThree = /^\d*[^\.]$/;
var productThree = document.getElementById('prod3').value;
if (productThree==null || productThree=="" || varifyThree.test(productThree)) {
return true;

[Code].....

View 8 Replies View Related

Form Verification Using Regular Expressions

Mar 7, 2011

I keep getting an error that says item is null. I'm a little lost because once I got my regExp to start working this actually worked for a little bit. When I came back I was getting an error.

var creditExp = /^([345])(\d{3})\-?(\d{4})\-?(\d{4})\-?(\d{4})$/;
var creditNumber = document.getElementById("creditnum").value;
var item = creditExp.exec(creditNumber);
document.getElementById("creditnum").value = item[1] + item[2] + "-" + item[3] + "-" + item[4] + "-" + item[5];
if (item[1] == 4 && document.getElementById("card1").checked == true) {
return true;
}else
if (item[1] == 5 && document.getElementById("card2").checked == true) {
return true;
}else
if (item[1] == 3 && document.getElementById("card3").checked == true) {
return true;
} else {
alert("You must enter a valid credit card number.");
document.getElementById("creditnum").focus();
return false;
}
var billingName = document.getElementById('creditname').value;
if (billingName == null || billingName == "") {
alert("You must enter your first name as printed on your credit card!");
document.getElementById('creditname').focus();
return false;
}

View 1 Replies View Related

Use Logical Expressions In A Switch / Case?

Aug 31, 2009

I'm doing a bit of experimentation and would like a bit of advice if possible please.

In my switch statement I would like to use the || or operator, it works correctly it I set the case to 31, but if I try 1||31 it doesn't.code...

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved