I need the page to redirect if x is null AND the screen width is less then 600. My problem is the page is still redirecting even if the cookie has a value.
To make sure my cookie was working properly I just tested an alert of x and it gave x's value.
Code: <script type="text/javascript"> var x = readCookie('mobile') if (x==null && screen.width < 600); {
when the visitor wants to register on my site, they have to fill in there email address in the requiered field and then check the terms box to activate the register button...thats all good, but there seems to be a bit of a bug......it seems that when they fill in the email address and press return, it skips passed the terms box and goes straight to the register page...
i get a syntax error message (line 43 character 82) for this line if (document.contest.month.selectedIndex=5 && document.contest.day.selectedIndex=31) { what am i doing wrong here (it is an alert message if the person's birthday is the 31st of may)
Rules: create an array for the user to type 5 strings in a prompt that will be displayed in an alert box.
User must type in the prompt an alert will display what the user typed if the prompt is empty or contains nothing an alert will display telling the user to enter text user clicks ok on the alert box and is sent back to the prompt box
editor.addMenuItem = function( name, definition ) { if ( groupsOrder[ definition.group ] ) menuItems[ name ] = new CKEDITOR.menuItem( this, name, definition ); };
// This code is defined in another file:
if (editor.addMenuItems) { editor.addMenuItems({ footnote : {[code]....
what the 2nd block of code means? Does it mean : If the function editor.addMenuItems exists, then call it with the following parameters?? i.e If the function exists then execute the following:
I have an index file that contains absolute barebone html statements and a Flash application. The application is set internally to occupy 100% of the screen. Test site is Flipsauto.info I need to have a content area offset with a DIV statement but can't remember the syntax. In other words, the content area will contain text for search engine spiders to analyze but not be viewable by the user.
"Tester" is the id of a div with it's visibility set to visible. No matter what, though, I always get "Else" returning. Do I have a syntax error with the above, or is what I'm trying to do not possible at all??
I am having a problem changing the color of 2 differnt table cells when mouseing over of 1cell. The issue is I want to change the bgcolor of my cell that I am mouseing over as well as an adjacent cell, but not the whole row. The script changes only one, whichever the 1st one is and does not execute the 2nd mouseover, it is probably a syntax problem but I was wondering if anyone had any ideas
I am in the process of porting an application i have been building for a couple of years to jQuery from jquery/prototypejs&scriptaculous.
Reading the new documentation i see that bind can take multiple observers (for example)
$( "div.test" ) .bind (
[Code].....
Is this also true with "live" ( i am adding alot of dynamic elements to a page that have tooltips attached to them and have written a simple tooltip plugin that uses live to stop me constantly needing to call the plugin everytime somehting on the page changes to do with the tooltip..
I have a code that I got from a tutorial website. The goal is when someone clicks the first check box with the value of yes then the two other sets of check boxes will autmatically be checked for no.
The issue is their are three sets of 2 check boxes each.
So here is my code code I am trying to use
PHP Code:
Here is my form code
PHP Code:
So Ideally when a representative clicks that the customer has three services (clicks the Yes checkbox) all the other checkboxes will default to No.
How I would change the above javascript to do this.
I have a simple example below showing how when I pass in the value of the value attribute of option node, and then use if operator to check whether parameter is a string or not, even though it's a string, it converts it to false boolean and triggers the else statement rather than calling a function.callback should be a string so why is it saying otherwise?
Ive got a project and ive been steaming ahead with it myself for a bit, i was given the code to start off with but have adapted it for my own needs. As well as fieldOne being a minimum of 3 characters I also need to check if the first three characters are the same because we get a lot of spam.
I don't know why it's not running the validation js first upon "submit", it goes straight to the "thankyou" page specified by the php (let me know if php needs to be posted). I've check my syntax over and over, I can't see anything.
I'm trying to have a "tell-a-friend" form where one requires to enter his/her first name, surname, email and a friend's email � with option of forward to to other 4 friends (total 5).
I have to check for several possible values of a variable and I currently do it like so: (SHIP_TYPE == "M" || SHIP_TYPE == "S" || SHIP_TYPE == "X") But this seems overly manual to me. I'm imagining something like the SQL "IN" function: SHIP_TYPE IN ('M','S','X') Does such a thing exist in JavaScript, or do I need to write my own function?
I have developed an application in PHP.The user will find the list of experts and this code is generated based on the experts data in database.. It is working fine..
The users selects the expert according to his wish ( checks using check box provided before the expert and there is no restriction in selecting experts) .
Now he enters the question, he needs the reply and then he clicks on submit button.An email must be sent to the expert I need the javascript to find whether the USER CHECKED the Check boxes or NOT.
Script works on the first attachment but not the other two? <script type="text/javascript" language="JavaScript"><!-- function ExtensionsOkay() { var extension = new Array(); var fieldvalue = new Array(); fieldvalue[0] = document.customApp.attachment_1.value; fieldvalue[1] = document.customApp.attachment_2.value; fieldvalue[2] = document.customApp.attachment_3.value; extension[0] = ".doc"; extension[1] = ".docx"; extension[2] = ".txt"; extension[3] = ".pdf";
// No other customization needed. for(var f = 0; f < fieldvalue.length; f++) { var thisext = fieldvalue[f].substr(fieldvalue[f].lastIndexOf('.')); for(var i = 0; i < extension.length; i++) { if(thisext == extension[i]) { return true; }} alert("Your upload field " + f + " contains an unapproved file name."); return false; }} //--></script>
is there a way to find out if a Javascript function exisits on the page more than once? I know I can do window.FunctionName and return a boolean to find out if it exists or not, but I'm trying to check and see if I have multiple functions with the same name on the page.
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
i'm a newbie on jquery i'm studying it with the latest version, and following a book called "Learning Jquery" but iencountered a error, and i don't know what the problem is:
i copied the code from the book like this:$('a[@href^="mailto:"]').addClass('mailto'); to try to change the links which start with "mailto" to the new class "mailto" but there's a error reported: uncaught exception: Syntax error, unrecognized expression: [@href^="mailto:"]
I am trying to store multiple text values into an array when a check box is checked. for example when row1 checkbox is checked the values row1col1 and row1col2 are stored in an array. note however row1col1 and row1col2 are editable and not readonly. for example:
<table border="1"> <form id="form1" name="form1" method="post" action=""> <tr> <td>row1 <input type="checkbox" name="row1" id="row1" /> (when checked the text fields are editable) </td>