hide div when not clicking on it - JavaScript Help


I have the following javascript:
function createDiv() { var newDiv = document.createElement("div"); newDiv.setAttribute("id","box"); document.body.appendChild(newDiv); var box = document.getElementById("box"); } and html:
that creates a new div on the page. What I would like is for this div to completely disappear when a user clicks anywhere else on the page. What I mean can generally be seen on any javascript date picker/calendar for forms.
Posted On: Wednesday 2nd of January 2013 12:42:25 AM Total Views:  340
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




preformatted text fields...?

Hi Everyone; I'm working on a project to create an html form for users to input their contact information. I was wondering: is there a way to have a pre formatted text field For example, to have a form text field that has the brackets for the area code and hyphen for the respective digits here is the link to the test site: http://www.cultureisaweapon.org/pals/index_spanish.html (please take a look at the "numero de telefone" field) currently the brackets and hyphen appear after the user types in information, and they actually want to have the bracket and hyphen appear BEFORE the user inserts data.
VIEWS ON THIS POST

111

Posted on:

Monday 19th November 2012
View Replies!

basic loop

Hi. I try to use some of the OOP. function Tag(name, value, x, y){ this.name = name; this.value = value; this.x = x; this.y = y; } var star = new Tag( 'sun', 29, 10, 10); var cube = new Tag('cube', 101, 10, 20); var circle = new Tag('red ball', 50, 10, 20); now how would i create a loop that will scan all the objects that created and do sotmthing like that: for (obj in object.Tag) { alert (obj.name); } thank you MOD EDIT: When posting code...USE CODE TAGS!!! This post has been edited by JackOfTrades: 14 October 2010 - 03:31 PM
VIEWS ON THIS POST

130

Posted on:

Wednesday 21st November 2012
View Replies!

GPA Calculator for javascript

I am having problems with trying to see what is wrong with my code. here is the prompt Create a web page that will help the instructor record students grades and their corresponding GPA. Begin by asking the instructor how many students are in the class. Then for each student, ask for the student's name and the three test grades (A, B, C, D, or F). Then calculate the students GPA. Display (using document.write()) the students' name, test grades and GPA in a table as in the following example: Name Course A Course B Course C GPA John A B B 3.33 Steve B C A 3.00 Smith A A C 3.33 See LectureNotes 15, slide 9 for an example. Note: GPA = TotalQualityPoints / TotalCreditHours; Assume each course is 3 credit hours and the quality points for grade A, B, C, D and F are as follows: A 12.0 B 9.0 C 6.0 D 3.0 F 0.0 If a students three test grades are A, A and C, then this students GPA is: GPA = (12+12+6)/(3+3+3) = 30/9 = 3.33 Now here is my code: Student Grades This web page is dessigned to help the instructor record student's test scores and calculate the average score for each student. var name=new Array(); var courseA=new Array(); var courseB=new Array(); var courseC=new Array(); var gpa=new Array(); var numofstudent; numofstudent=parseInt(prompt("How many students do you have","")); var i; for(i=0;i
VIEWS ON THIS POST

63

Posted on:

Wednesday 21st November 2012
View Replies!

if... else... statement won't run properly

I have a page that submits a form (via jQuery's AJAX function) to a ColdFusion page. The ColdFusion page returns either "true" or "false" and Javascript removes all of the whitespace and line breaks from it. $.ajax({ // The file to send to url: "/admin/controllers/body.cfcmethod=update", // GET method is used type: "GET", // Pass the data data: data, // Do not cache the page cache: false, // Success success: function(html){ var newHtml = html.replace(/(\r\n|\n|\r)/gm,""); var newerHTML = html.replace(/^\s+|\s+$/g,""); // the url returned 1/true (update was successful) if(newerHtml != true){ alert("Sorry, unexpected error. Please try again later."); }else{ alert("Your browser will now be refreshed to display the most recent changes."); //window.location.href = sURL; } } }) The problem is that no alerts popup. I know that it is going through properly because when I look at the Firebug console it tells me the output: html "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\ntrue" newHtml " true" newerHTML "true" Can anyone see why this wouldn't work
VIEWS ON THIS POST

102

Posted on:

Wednesday 21st November 2012
View Replies!

JavaScript age verification

, this is my first post on here and looking for some help with JS. I am having issues figuring out the coding for age verification. I am using drop down menus (options) and basically trying to have a minimum age of 18 years old. I have tried several different code methods of trying to receive an alert to tell the user that they are not old enough. I have included the other code I was working with but just commented it out. function checkForm(){ var min_age = 18; //var today = new Date(); //var CurrYear = today.getFullYear(); //var CurrMonth = today.getMonth() + 1; var year = parseInt(document.forms["Voter"]["year"].value); var month = parseInt(document.forms["Voter"]["month"].value) - 1; var day = parseInt(document.forms["Voter"]["day"].value); var theirDate = new Date((year + min_age), month, day); var today = new Date; if ((today.getdate() - theirDate.getdate()) < 0) { alert("You must be at least 18 years old to vote!"); return false; } else { return true; } } The rest of the code/page is a form that has day with drop menu (1-31), month with drop menu (1-12), year drop menu (1900-2004). Problem is the user can select the menu items but when the form is submitted if they are not 18 years old or older it is supposed to alert them. I have tried different methods to code this and can't seem to find the right combination to make it work, any suggestions would be greatly appreciated. if(document.Voter.Name.value=="") [/code]
VIEWS ON THIS POST

57

Posted on:

Wednesday 21st November 2012
View Replies!

Please Help! Enable/Disable

Hi can anyone tell me whats wrong with this code... I need to have all feildsets disabled when the page loads and depending on which 4 of the radio buttons I select, have that fieldset be enabled and leave the rest disabled! Ive been tweeking it for so long, don't know what more to do! Any help would be Hugely appreciated,
VIEWS ON THIS POST

57

Posted on:

Wednesday 21st November 2012
View Replies!

Help_A2 ICT

Hi im currently studying ict a level and we have to design a mulitmedia product in flash, i am a complete newbie to flash, and im wondering how you make a small text box appear on a mouseover a piece on text
VIEWS ON THIS POST

105

Posted on:

Saturday 24th November 2012
View Replies!

Accessing the radiobutton value inside the table element?

You could loop through cell[2].getElementsByTagName('input') and check if the selected property is true.
VIEWS ON THIS POST

101

Posted on:

Saturday 24th November 2012
View Replies!

jquery animate li in order

I have a ul and I would like to animate each li in descending order, and I'm having no luck on this. my current code it, function menuItemsIn(){ $(".ac_menu ul li").each(function(){ $(this).animate({marginTop : '0px', opacity : '100'}, {duration : 'slow', easing : 'easeInBack'}).delay(200); }); } It animating all the li's together, and what I want it to do is. Animate one li, then the next, and so on.
VIEWS ON THIS POST

126

Posted on:

Saturday 24th November 2012
View Replies!

On Function Call

, On a site I'm developing there is a separate Javascript file loaded when users are logged in as admin, for the sake of this I'll call it admin.js. This file contains a function called adm_linkify(); which adds 'Edit This Content' links to certain elements. There is also a main Javascript file (main.js) which contains a function called open_dynload();. This function is called to dynamically load a page through Ajax. When the ajax content loads, the function adm_linkify(); needs to be run (To linkify the new content). The problem is I can't just use function open_dynload() { //Function adm_linkify(); } Because the function is not avaliable to standard users. So my question is, is there something I can do to admin.js WITHOUT changing main.js to basically say When open_dynload() is called, run adm_linkify() If this is not possible, can you do something like if adm_linkify() is a valid function run adm_linkify(); Which I can put in main.js, I would prefer if it could be done the first way but if it's too complicated then the second method would be OK. -Sam
VIEWS ON THIS POST

77

Posted on:

Saturday 24th November 2012
View Replies!

Scoping anonymous functions

Hi I have a loop looping through an "band" object array. I am assigning a anonymous functions for the object property(actually dragging) for (var j=0;j
VIEWS ON THIS POST

85

Posted on:

Saturday 24th November 2012
View Replies!

Need help with figuring out how to grab the videos?

I am trying to download the full videos behind this flash player. Please investigate.
VIEWS ON THIS POST

115

Posted on:

Saturday 24th November 2012
View Replies!

How do I add this javacript code into a php coded?

all! I do not have a great knowledge of php but I do know basic html. I have a javascript popunder script that I would like to try on my site that runs on a php script. I know how to insert this script into an html page but I can't get it to work in php. I inserted the javascript that would go in the of the html, before the
VIEWS ON THIS POST

91

Posted on:

Saturday 24th November 2012
View Replies!

Help regarding comparison of String in JS

How to do this type of comparison. Say i have a variable with a word "ABCDEF" and i want to check the combination "DEF" exists in it or not how do i do I want to make a simple comparison test.. Some friend suggested me the "substring" function but that works only in JSP i hope Please help me out!
VIEWS ON THIS POST

134

Posted on:

Saturday 24th November 2012
View Replies!

How to move a button using Javascript on MouseOver

hi, I want to move a button to new location at the mouseOver event in JavaScript.. Please have a look at my code below. function move() { b1.style.position = "relative"; setTimeout(b1.style.left = 100,1000) } Im able to move the button to the new location but its moving very fast,I want to move the button slowly.Much like when we use .hide("slow") I have tried using setTimeout(b1.style.left = 100,1000) but its not working.. Please guide how to do it
VIEWS ON THIS POST

108

Posted on:

Sunday 25th November 2012
View Replies!

Slideshow Messed-up

[IMG]http://i1235.photobucket.com/albums/ff429/rakwel10/pix.jpg[/IMG] The picture above may not be that clear but this is my website created in Wordpress. As you can see, the slideshow is messed up. When the first slide will show up, the next slide is showing too under the first slide. When I try to zoom out the website and refresh it, its getting arranged. What do you think is the problem
VIEWS ON THIS POST

134

Posted on:

Sunday 25th November 2012
View Replies!

Modifying Database without posting to server (e.g.?

I was wondering about the technology used by Facebook and Twitter (those are the obvious and most popular ones). I have realised that when adding a status or a comment or subscribing to a conversation, the page does not actually post to server to modify the database. Actually, on click the page does not load and it seems like all is done on the client-side yet I believe that some sort of data is stored. How is this possible Can anyone help since I would like to use this type of technology Or they using jQuery If yes, then how is the database modified
VIEWS ON THIS POST

106

Posted on:

Sunday 25th November 2012
View Replies!

lost some of code ? cant fix it

Ive accidently deleted something needed in the body I think for this code, but I cannot work out what it needs. I think the descarea div is missing Can you help me rewriteit function Request() { if (window.XMLHttpRequest ) { return new XMLHttpRequest(); } else if (window.ActiveXObject) { try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { return false; } } } } function SetDescPos(e) { if (typeof event!='undefined') { e=new Object(); e.pageX=event.clientX+document.body.scrollLeft; e.pageY=event.clientY+document.body.scrollTop; } descarea=document.alldocument.all.miniTopic:document.getElementById("miniTopic"); descarea.style.left=e.pageX+2; descarea.style.top=e.pageY+2; } function GetTopic(url,tTitle) { maxlen=300; if (typeof saveDesc=='undefined') { saveDesc=[]; } if (typeof saveDesc[url]!='undefined') { descarea=document.alldocument.all.miniTopic:document.getElementById("miniTopic"); descarea.innerHTML=""+tTitle+""+saveDesc[url]; descarea.style.display=''; } else { url=url; tTitle=tTitle; descReq=Request(); descReq.open("http://inny.ipbfree.com/GET",url); descarea=document.alldocument.all.miniTopic:document.getElementById("miniTopic"); descarea.innerHTML="Loading Topic Preview...Please Wait... "; descarea.style.display=''; descReq.onreadystatechange=function() { if (descReq.readyState==4) { txt=descReq.responseText; txt.match(/
VIEWS ON THIS POST

137

Posted on:

Sunday 25th November 2012
View Replies!

how to restrict user from click another tabs menu

Hi , I have 3 horizontal tabs menus with different form to let user key in some infor to the text fields. When user 1st time access this page, all fields are blank. But if user want to go to the second tab, user must key in some infor at the 1st tabs form. How do I check if user didn't key in anything in the 1st tabs form I want to force user to key in the 1st tab's form in order to allow user to click the second tab form and 3rd tab form. What I want is if user didn't key in anything at the 1st tab's form, an alert will prompt out and tell the user to key in the text in the textfield at 1st tab form and save the data into mysql DB. Or else he can't even pressed the second tab form or 3rd tab's form. How should I proceed with this requirement. I using yui tabview to show the tab menu. the form is within the same page. Here is the sample of how my tab menu look like: http://developer.yahoo.com/yui/examp...rommarkup.html So when user click 1st tab and then to next tab menu, i need to verify if user is allow to click 2nd tab. Or else force user back to 1st tab. Each tab will have a content. I am using php and mysql for data storage. I think of using javascript to do this but my javascript is knowledge is a bit crappy.
VIEWS ON THIS POST

80

Posted on:

Sunday 25th November 2012
View Replies!

passing selected radio button value from js to java

Hi all, I have two radio button yes,no in a.jsp. var IncludeCharges = document.getElementById("IncludeCharges_no").value; If i select yes i need to pass 1 to the java file and in case of no i need to pass 0. but when i retrive the radio button value using int Includecharges = Integer.parseInt(request.getParameter("IncludeCharges_yes"); It shows undefined... How could i get the value
VIEWS ON THIS POST

334

Posted on:

Monday 26th November 2012
View Replies!

Ajax not working in Mozilla firefox

I have tested following code and it works fine in IE but not Mozilla: var ajax = false; if (window.XMLHttpRequest) { ajax = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { ajax = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e1) { try { ajax = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) {} } } if (!ajax) { alert ('Some page functionality is unavailable.'); } Please tell me what is the solution
VIEWS ON THIS POST

317

Posted on:

Monday 26th November 2012
View Replies!

window.open rendering with MIME types

, In the postback of my asp.net linkbutton, i'm HTTP POST invoking a report (from our SQL Reporting server). In my case it must be POST because of long params sent to the report server. The report server returns a ...
VIEWS ON THIS POST

121

Posted on:

Friday 30th November 2012
View Replies!

I am difficulties with DOM

I cant seem understand the problem. i have narrow it down to line 16-20 but i may be wrong. Here is my codes. Any assistance and guidance will be greatly appreciated.. var emptyCart = true; var salesTotal = 0; var curRow = 1; function addItem (selectedItem) { if (emptyCart == true) {document.getElementById("shoppingCart").deleteRow(0); emptyCart = false; }} var lastItem = document.getElementById("shoppingCart").rows.length; var cartTable = document.getElementById("shoppingCart"); var newRow = cartTable.insertRow(lastItem);document.getElementById("chocolateTable").rows[lastItem].id = "R" + curRow; var itemCell = newRow.insertCell(0); itemCell.innerHTML = selectedItem; var priceCell = newRow.insertCell(1); priceCell.innerHTML = itemPrice; var actionCell = newRow.insertCell(2); actionCell.innerHTML = ""; ++curRow; var curItem = document.getElementById("chocolateTable").rows[selectedItem].cells; var selectedItem = curItem[0].innerHTML; var itemPrice = curItem[1].innerHTML; salesTotal += parseFloat(itemPrice.substring(1));document.getElementById('total').innerHTML = "Sales total: $" + salesTotal.toFixed(2); function removeItem(rowNum) {if (document.getElementById("shoppingCart").rows.length == 1) { document.getElementById("shoppingCart").rows[0].cells[0].innerHTML = "Your shopping cart is empty"; document.getElementById("shoppingCart").rows[0].cells[1].innerHTML = "$0.00"; salesTotal = 0; document.getElementById('total').innerHTML = "$" + salesTotal.toFixed(2);emptyCart = true; } else { var selectedRow = document.getElementById(rowNum).rowIndex; document.getElementById("shoppingCart").deleteRow(selectedRow); var itemPrice = document.getElementById("shoppingCart").rows[0].cells[1].innerHTML; salesTotal = salesTotal - parseFloat(itemPrice.substring(1));document.getElementById('total').innerHTML = "$" + salesTotal.toFixed(2); } } Central Valley Chocolates Gourmet Chocolates Chocolate Truffles$34.99 Pecan Caramel Duets$14.99 Chocolate Covered Cherries$28.99 White Chocolate Ganaches$22.99 Chocolate Mints$17.99 Chocolate Caramels$14.99 Chocolate Toffee Bark$9.99 Your Shopping Cart Your shopping cart is empty   This post has been edited by Dormilich: 31 January 2012 - 01:05 AM Reason for edit:: please use [CODE] [/CODE] tags when posting code
VIEWS ON THIS POST

310

Posted on:

Sunday 23rd December 2012
View Replies!

javascript: void(0)

java script: void(0) every time i click on some page this error comes in !!! and the site never opens !! help please !!!!
VIEWS ON THIS POST

116

Posted on:

Monday 24th December 2012
View Replies!

ajax cookies (get cookie) - JavaScript Help

hey ive made a script which returns the field values (script below)but the problem i have is with this line herevar cookie_value = $.cookie(id);cause if there isnt a cookie with that value which exists it casues the script not to work...can anyone help out here please on how i could get this to work correctly pleasefunction remember_field_value(selector) { selector = '#' + selector; var id = $(selector).attr('id'); var cookie_value = $.cookie(id); if (cookie_value !== null) { if ($(selector).attr('type') == 'checkbox') { $(selector).attr('checked', cookie_value); } else if ($(selector).attr('type') == 'text') { $(selector).val(cookie_value); } else if ($(selector).attr('type') == 'select-one') { $('#' + cookie_value).attr('selected', 'selected'); } } $(selector).change(function() { if ($(selector).attr('type') == 'checkbox') { if ($(selector).attr('checked')) { $.cookie(id, true); } else { $.cookie(id, null); } } else if ($(selector).attr('type') == 'text') { var value = $(selector).val(); $.cookie(id, value); } else if ($(selector).attr('type') == 'select-one') { var option_id = $(selector + ' :selected').attr('id'); $.cookie(id, option_id); } }); }
VIEWS ON THIS POST

124

Posted on:

Wednesday 2nd January 2013
View Replies!

Multiple Forms - JavaScript Help

I'm a beginner with javascript, but I want to change my script, that the site doesn't always reload after saving a form. One form with one id I'm able to do, but different forms with the same id I don't know how. These are my forms:QuoteTwitter Follower AdderSite active Yes NoCredits Esoterik ForumSite active Yes NoCredits Twitter Train TweeterMESite active Yes NoCredits Kartenlegen und HellsehenSite active Yes NoCredits AstrologieSite active Yes NoCredits Spirituelle LebensberatungSite active Yes NoCredits Now my question, is there a way to submit each form without reloading the site
VIEWS ON THIS POST

90

Posted on:

Wednesday 2nd January 2013
View Replies!

Insert PHP output into JS variable. - JavaScript Help

Is it possible to make Javascript get output our of php pagefor instance:i want to insert this pagesomething.phpname=jackinto var data
VIEWS ON THIS POST

52

Posted on:

Wednesday 2nd January 2013
View Replies!

Java script working in IE but not in Firefox. - JavaScript Help

I have a sample code in which validation is done by java script.. working fine in IE but not working in firefox. Please suggest. code below
VIEWS ON THIS POST

55

Posted on:

Wednesday 2nd January 2013
View Replies!

jquery selectors problem - JavaScript Help

hey, $("a[name^=del_comment]").click(function() { $.ajax({ type: "GET", url: "index.phpuserid={$core->input['userid']}&CODE=delete_comment&id="+$(this).attr('id'), context: document.body, success: function(msg){ alert(msg); $('#all_comments').fadeOut('slow').load("index.phpuserid={$core->input['userid']}&CODE=get_comments").fadeIn('slow'); } }); return false; }); all i trying to do is to set an "onclick" event to all tags which there names starts with "del_comment" X X X X this code works fine, but for some reason, when i hit one of the links, this works, but if i try to hit again one of them, this will not work,i mean this works only one time and i have to reload the page to get it wrok again...hope you understand...sorry for my poor english...THANKS!
VIEWS ON THIS POST

267

Posted on:

Wednesday 2nd January 2013
View Replies!

jquery hiding a dynamically generated table column - JavaScript Help

I have been playing with jQuery columnManager plugin today http://p.sohei.org/s.../demo/demo.htmland I have been having a problem getting it to work with a dynamically created table ( generated by a jquery ajax call )the code works fine on a static page but i havent been able to figure out the selector for a dynamic tableany ides $('#table').hideColumns(3);
VIEWS ON THIS POST

66

Posted on:

Wednesday 2nd January 2013
View Replies!

Something wrong with jquery.validate plugin? or is it just my code?? - JavaScript Help

. i am currently working on form and i am using jquery.validation.js.. i have placed this form inside an iframe so it will be fetched when i click a tab. my problem is, i did a little editing, removed some unnecessary css code. it works fine in FF but when i tried it on IE 7, the validation messages (error messages) that supposed to show up in the form doesn't seem to show..little help please
VIEWS ON THIS POST

68

Posted on:

Wednesday 2nd January 2013
View Replies!

multiple div refresh - JavaScript Help

Below is the scriptfunction refreshflag(){var totalx=document.getElementById("totaluser").value;var spx=totalx.split(";");if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }for(i=0;i
VIEWS ON THIS POST

102

Posted on:

Wednesday 2nd January 2013
View Replies!

alert box - JavaScript Help

Hi ,i want to display in information by hiding background , so that i can get more of users attention.can any one has the script for this take a look at attached screenshot with this.[attachment deleted by admin]
VIEWS ON THIS POST

104

Posted on:

Wednesday 2nd January 2013
View Replies!

Dynamically resize fancybox popup window - JavaScript Help

I've got an index.php page which then opens cars.php in a popup window using fancybox. However, the popup window is always too big for the content which is within it. I've googled it and assumed autoscale or autoDimensions would do the trick but unfortunately not. The content within cars.php can change depending on what I click on within index.php, therefore I can't set a static height and width. Is there any other way of doing it cars.php contains a head and body tag which contains multiple images and some text.
VIEWS ON THIS POST

57

Posted on:

Wednesday 2nd January 2013
View Replies!

fatih - JavaScript Help

HELLO my friendi want to put textbox this php codes but it does not workfor this use combobox onchange event i call "bul()" function but it does not workingTalep Form\t
VIEWS ON THIS POST

63

Posted on:

Wednesday 2nd January 2013
View Replies!

Change the SELECT value in drop down based off of a javascript variable value - JavaScript Help

I want to change the SELECT value based off of a javascript variable value. For example, I wantvar myvariable = NULL;If myvariable = ONLINE do this: ONLINE ONSITE else If myvariable = ONSITE do this: ONLINE ONSITE
VIEWS ON THIS POST

148

Posted on:

Wednesday 2nd January 2013
View Replies!

JavaScript [w/jQuery] - Post a page request - JavaScript Help

,So. I wanted to post to an external script (cross-domain) in Javascript. This is not my domain, though it's a partner.I figured it would be SO MUCH easier to just post using jQuery's $.post() method, and problem solved. Well done! The problem was solved, until I ran it in IE - uh oh, IE doesn't like itI researched this problem, and it seems it's an IE security problem with cross-domain blahblah.My question How would I go about achieving the exact same result (just to post to the script, without actually making the user run it) - I am not actually posting any _POST or _GET variables, I was only using $.post() because it was a convenient solution.My old attempt, which IE didn't like $.post('http://External_Site.com/External_Script.php'); (Obviously that isn't the real URL
VIEWS ON THIS POST

73

Posted on:

Wednesday 2nd January 2013
View Replies!

What is the difference between # and #! - JavaScript Help

what's the difference of the hashes in urls"#"and"#!"What's the benefit or whatever of the !
VIEWS ON THIS POST

43

Posted on:

Wednesday 2nd January 2013
View Replies!

Image as Link - JavaScript Help

,I'm using an image as a link, and I basically create a new image element, set its source, create an "a" element, set it's href, and then I append the image as a child to the link. However, what I get is a button with a blue outline, as links are blue, and it automatically makes that blue outline on the button. I tried to force the border-color property to black (that's the background color of the page), but it still gives me that blue outline.Any idea how to disable that, or turn it black
VIEWS ON THIS POST

63

Posted on:

Wednesday 2nd January 2013
View Replies!

using a calendar script, how to prevent old date selected - JavaScript Help

I have this code which is a calendar popup script.How do I prevent a user from selecting an old date.How can the old date numbers be disabled //
VIEWS ON THIS POST

72

Posted on:

Wednesday 2nd January 2013
View Replies!

2 problems, why won't alert box work and why won't image change? - JavaScript Help

function toggleBg(plus) { if (document.getElementById(plus).style.background=="url('/images/plus.png')"{ document.getElementById(plus).style.background="url('/images/minus.png')"; }else{ document.getElementById(plus).style.background="url('/images/plus.png')"; } } alert("This is a test alert message"); I wanted to change the image of a button when it is clicked from a plus to a minus and then back to a minus. The problem is, it won't change when clicked and if I put minus in the the else bit, it changes to a minus. "url('/images/plus.png')" doesn't seem to match the actual property, so I wanted to get a printout of the actual property using an alert box. But the alert box won't even work when it is in the presence of that function. If I delete the function from the script area, the alert box works. Why doesn't the alert box work in the script above
VIEWS ON THIS POST

189

Posted on:

Wednesday 2nd January 2013
View Replies!

iframe design mode focus - JavaScript Help

I have an iframe that is in design mode, when a user selects text and presses the bold button for example, how can I make it keep the focus after the user bolds the text
VIEWS ON THIS POST

71

Posted on:

Wednesday 2nd January 2013
View Replies!

onClick doesn't work - JavaScript Help

To View The Problem1. http://www.oddim.com/2. Login as test/test3. Hit Update Status4. Notice how when u click the red x the onclick doesn't runDoesn't work on Firefox, that is the problem...Any ideas
VIEWS ON THIS POST

59

Posted on:

Wednesday 2nd January 2013
View Replies!

Scrollbar position - JavaScript Help

Currently got chat box done using SQL and PHP, however when text overflows the scroll bar won't stay at the bottom..Currently using this code (within header): var objDiv = document.getElementById("site_chat_box"); objDiv.scrollTop = objDiv.scrollHeight; Unfortunately it doesn't work :confused:Any ideas
VIEWS ON THIS POST

67

Posted on:

Wednesday 2nd January 2013
View Replies!

Submit form in Greasemonkey - JavaScript Help

I am making a greasemokey script that gets information from the current webpage, creates an invisible form and submits it automattically. The problem I am running into is getting the form to submit. I get an error saying that submitForm does not exist. I did some searching around and could not find much other than the default submit function does not work with greasemonkey. does anyone know how to acheive this
VIEWS ON THIS POST

75

Posted on:

Wednesday 2nd January 2013
View Replies!

Widgets development, how to start? - JavaScript Help

I need to develop a widget.I have read that it is better to develop using Javascript, but using a simple IFrame it is easier.What should I do Develop using Javascript or IFrame. Some tutorial on widgets using Javascript I'am very bad with Javascript.Best
VIEWS ON THIS POST

49

Posted on:

Wednesday 2nd January 2013
View Replies!

Imitating the index property - JavaScript Help

I have a list of DIVs in a DIV container and I want to be able to find out what index a specific div is in its parent's children collection. The other way around is easy. If I need to reference the 5th object in the container I simply use container.children[4]. But say I want the onclick event of one of those children to return its index number. This is where I am having trouble.The OPTION tag has an attribute called index that does just that, but I don't think I can format a select box to look the way I want it.Does anyone know of a tag that allows this attribute or a way to imitate its functionality Or even how to format a select box to not look like a select box
VIEWS ON THIS POST

62

Posted on:

Wednesday 2nd January 2013
View Replies!

placing javascript cookie value into a textbox - JavaScript Help

I want to place a Javascript Cookies value into a textbox, and I can't find any articles about it.
VIEWS ON THIS POST

77

Posted on:

Wednesday 2nd January 2013
View Replies!

Conflicting scripts making form not validate. - JavaScript Help

I have a enquiry from that is not validating (pop up boxes are meant to come up)Now that i have included this code into my headerlinks.php $(document).ready(function() { $(".signin").click(function(e) { e.preventDefault(); $("fieldset#signin_menu").toggle(); $(".signin").toggleClass("menu-open"); }); $("fieldset#signin_menu").mouseup(function() { return false }); $(document).mouseup(function(e) { if($(e.target).parent("a.signin").length==0) { $(".signin").removeClass("menu-open"); $("fieldset#signin_menu").hide(); } }); }); This code basically makes a pop out box for my sign in.this can be seen here http://www.languages...rse_enquiry.phpAt the top right where it says login. basically makes a box pop out when you click where you can sign in.However you will also notice that on the same page the course enquiry form below will send even with nothing in it, Before i had the above script it used to validate by little pop up boxes comming up. Heres the enqury page code where im using some js window.addEvent('domready', function(){ new FormCheck('two'); }); Can you see anyting on headerlink page that stops this form from validating because as i said before it was
VIEWS ON THIS POST

267

Posted on:

Wednesday 2nd January 2013
View Replies!

disable a form - JavaScript Help

.I'd like a form with one 'checkbox' type button. If that button is not selected, another part of the form, containing other select buttons and a text field, should be disabled. When you select the first button, the rest is also activated. After that, there is also a file type as input. (Or should I split it into multiple forms)I'll give a example of the form:
VIEWS ON THIS POST

248

Posted on:

Wednesday 2nd January 2013
View Replies!