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


ADVERTISEMENT

Writing A Basic If Statement ?

Feb 13, 2010

How would I write this in code?

Code:

View 4 Replies View Related

If Then Else Statement - Basic Flash Gallery

Sep 23, 2009

I have a basic flash gallery that I embedded into my site (HTML & CSS). When viewed in Firefox everything is fine (840px by 427px), but when viewed in IE the gallery changes size & needs to be (887px by 440px) to be viewed correctly.

So, I put an Javascript If Then Else statement. Now it targets and changes in the IE browser (width='887' height='440') , but it also changes the Firefox one to 887x440 when it should stay the original 840x427.

View 3 Replies View Related

Basic If Statement Validation - Form That Has 3 Radio Buttons

Dec 21, 2010

So i have a form that has 3 radio buttons and i want to validate so that you must select at least 2 Yes's. I am new to javascript so excuse my poorly written statement. It is non-functional, how to change this in order to make it functional.

Code:

View 4 Replies View Related

If Then Else Statement - Basic Flash Gallery That I Embedded Into My Site - HTML And CSS

Sep 23, 2009

I have a basic flash gallery that I embedded into my site (HTML & CSS). When viewed in Firefox everything is fine (840px by 427px), but when viewed in IE the gallery changes size & needs to be (887px by 440px) to be viewed correctly.

So, I put an Javascript If Then Else statement. Now it targets and changes in the IE browser (width='887' height='440') , but it also changes the Firefox one to 887x440 when it should stay the original 840x427.

View 2 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 :: If Then Statement Not Working Within A Success Function

Apr 29, 2010

Why my page is not redirecting within the if then statement.

Here is the code:

I have tried this without the if then statement and it works fine. I am not sure why my if then statement will not work within success function, am I doing something wrong?

View 10 Replies View Related

Switchh Statement Isn't Working?

Jun 18, 2011

why my switchh statement isn't working?

var rehash = inward.location.hash.match(/[^#]/);
switch(rehash)
{[code]......

View 1 Replies View Related

If Else Statement Not Working With Global Variable

Oct 13, 2010

The first time I enter the command n it should run the first if statement, when I enter n it should then run the second one as its in zone two. However this is just not happening..

// gameFunctions.js
// Javascript file for Game.html
// September 29th 2010 Edition

[Code]....

View 2 Replies View Related

If 0 Then Statement Not Working - Void(0) If The Height Is Not 10

Feb 5, 2009

<div id="mush" style="position:absolute;top:80px;left:1500px;width:200px;height:10px;background-color:black;" onmouseover="tim();"> <p>MUSHcode</p> </div>
<script type='text/javascript'>
var div;
var ts;
var te;
[Code]....

The script just stops working completely when the if, then statements is in there. The div's original height is 10, so it should work, because it only issues void(0) if the height is not 10.

View 1 Replies View Related

If Statement Not Working - Doesn't Return True And Display The DIV Block?

Mar 10, 2010

I've got an annoying non-working bit of code:

<div id ="messageDiv" style="display:block;">No profile information entered yet</div>
<script type="text/javascript">
function profileInfo() {
var m1 = document.getElementById("marital1").innerHTML.toLowerCase();
var b1 = document.getElementById("bodytype1").innerHTML.toLowerCase();
[Code]...

The first part up to before the 'else if' works. but if the 'w1' has [URL] it still doesnt return true and display the DIV block??

View 1 Replies View Related

JQuery :: "If Statement" Not Working

Sep 30, 2010

I'm trying to make a very simple image slider. For this I'm using a div which contains all the images next to each other, which is wrapped into a container div with an overflow:hidden. With a "previous" and "next" button I want to animate the margin-left property of the div which contains the images.

This is all working ok, but I want the div to reset back to it's original position when the last image has been reached and the user clicks on "next" again.

The width of one image is 500px, therefor I'm changing the margin-left with 500px each time. This is the code I'm using for that [code]...

Again, this is working fine. But when I wrap an if statement around the function, I cannot seem to get it to work the way I want[code]...

View 1 Replies View Related

If Statement Returning False On A True Statement?

Apr 4, 2011

my webstie allows users to change the color of the background, so to keep the text readable I have it changing as well.the color picker I am using has text boxes with rgb values 0-255 for each.I am trying to get one bit of text to alternate between red and blue with the conditions

Code:
if(blue>green && blue>red)
{

[code]....

View 2 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 :: 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

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 :: 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 :: 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 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 :: 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

JQuery :: Creating Basic Page For A Client To Allow Them To Update Photo Captions On Their Own

Jul 8, 2011

I am creating a basic page for a client to allow them to update photo captions on their own. The test page is here: [url]

There are only 4 photos right now for testing, but eventually there will be 100's. The issue I'm having is that only the first image caption is being updated. If I edit the caption for photo #4 and click update, it appears to update, but it actually doesn't. Further testing shows if I change the caption for #1 and click submit on ANY other caption, it updates #1. This makes me think that the jQuery code is only referencing the first form.

I know I could use ID's on the forms and in the jQuery to differentiate the forms, however the form HTML code is generated with PHP and there will be 100's of them. Is there any way for jQuery to determine which form was submitted? I need to be able to tell which form was submitted so I can use that form's caption text to update the photo caption via SQL (photo info stored in an SQL database).

Here's the code from the page. The forms are generated via PHP:

View 2 Replies View Related

"if & Else" Statement Not Working?

Mar 25, 2009

I was trying to make a javascript code that password-protects a web page without showing the actual password in the code. so I came up with this:

var p1=prompt("Password number 1");
var p2=prompt("Password number 2");
var p3=(p1*p2);

[Code]....

The idea is that you come up with two large prime numbers (the passwords), -in this case I used 18313 and 22307- that aren't shown in the script. Once the user imputes the numbers, they are then multiplied, and the product (in this case, 408508091) is then used to gain access. So if someone else wants access but doesn't have the passwords but has access to the code, they'll need to deduce the two prime numbers from the one larger number. It won't stop them completely but it should hold them off. (I know there are easier way's to password protect a web page so you don't need to remind me)

OK, now that I'm done blabbering here's the problem, the else statement isn't working. no matter what I do it always grants access no matter if the passwords are correct or not.

View 2 Replies View Related

JQuery :: Firefox - Setup A Basic Form With A Name And A Button (not Submit) And One Text Field

Jan 10, 2012

My first day with jquery, and I've just been playing around a little but have run in to a problem in Firefox.

I've set up a basic form with a name and a button (not submit) and one text field.

All it does right now is open an alert box when the button is clicked. That's fair enough. However, in Firefox, if I have the text field selected and hit enter, it doesn't press the button.

How would I go about making sure the enter key presses the button? I'd like to avoid using onclick and a method in the form if possible. My aim eventually is to post data and return it without a page refresh instead of create an alert box.

<html>

View 2 Replies View Related

JQuery :: Php Form With Basic Popup Notification Message When Php Has Made A Successful MySQL Db Update?

Jun 12, 2010

I have very basic javascript skills, just started looking into jQuery and jQueryTools to enhance my websites. I have been coding PHP for about 1.5 years.I have a php form with which users can update their purchase order before making a final confirmation and payment.

Thought it would be nice if, instead of using php for redirecting to a success/fail message in a separate php file and redirecting again back to the form with a 3 second delay, I could get a jQuery script to pop up with a success/fail message, so avoiding all the clumsy php redirecting and page refreshing.I've searched for plugins, but they all act on event listeners attached to a submit button or other clickable html element.Ive searched the net for ages and can't find an easily understood explanation and complete example, where a jQuery pop up notification is displayed in response to a php script executing a db update.

View 1 Replies View Related







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