There are just a couple things you missed:
<script type="text/javascript">
function checkText() {
var code = document.getElementById("txtCode").value
var special = document.getElementById("radSpecial")
if (code == "special code")
{
special.disabled = false;
}else{...
var my_string = "This is a string, it has a comma";
my_string = my_string.replace(/,/g,"");
"It is the mark of an educated mind to be able to entertain a thought without accepting it." - Aristotle
Well, I got a little bored:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><title>Timer</title>
<script type="text/javascript"><!--
function cTime()
{
today = new Date();
tempMon = 7-Math.abs(1 - today.getDay());
nMonday =...
Yeah, you need to add the global indicator and change your syntax a bit, like this:
var string1 = "hello:dolly:"
var string2 = string1.replace(/:/g," ");
that should do it
"It is the mark of an educated mind to be able to entertain a thought without accepting it." - Aristotle
Does anyone else think its kind of weird to hear about the "hit new AJAX" technology? This stuff's been around forever (well, awhile), it's just gotten a nice little acronym and recognition thanks to Gmail and others. It can't just be me, can it? ;-)
"It is the mark of an educated mind to be...
I've checked this out in FF1.0.7 and IE6, and it gave me different results each time, so the output depends on your browser. I assume the line var p = m.length-8; is to get rid of the time. This might work for you:
var m = "Page Updated " + document.lastModified;
document.writeln("<right>")...
Doesn't technically disable everything, but they can't click on the objects in the div(s)...here's a working version (tested in IE6 and FF1.0.7):
<html>
<head>
<script type='text/javascript'>
cDivs = new Array();
function disableDivs()
{
d = document.getElementsByTagName("BODY")[0]...
Personally, I would go with this method to add options to your select element:
y = document.getElementById("front_zoek_regioID");
newOp = document.createElement("option");
newOp.appendChild(document.createTextNode("test"));
newOp.value = "testVal";
y.appendChild(newOp)
firefox doesn't seem to...
You could always fake getElementsByClassName:
function getElementsByClassName(a) {mArr = new Array();d = document.getElementsByTagName('*');for (x=0;x<d.length;x++){if (d[x].className == a){mArr[mArr.length]=d[x];}}return mArr;};
then just call it:
getElementsByClassName("className");
it...
do you want to use onClick='foo(this.checked)'
"It is the mark of an educated mind to be able to entertain a thought without accepting it." - Aristotle
Not sure if this is your problem, but in firefox you need to pass the event to the function like fName(event) then in your function, add a line at the beginning like this:
if (!event) event = window.event;
Also, you should probably change that last line to accomodate the documentElement...
Nah, there's always a way...well...usually.
Why not try putting the select in a div, then literally rewriting the div with the new option included in the select:
function test(list)
{
old = list.innerHTML;
newOp = "<option value='value'>Text</option>"...
I suppose you could try:
newOp = document.createElement("option");
newOp.appendChild(document.createTextNode("text"));
newOp.value = "value";
list.appendChild(newOp);
"It is the mark of an educated mind to be able to entertain a thought without accepting it." - Aristotle
Have you tried removing one of the equal signs in this:
field.checked == false; so that it looks like field.checked = false;?
you only need one equal sign when assigning values, two when checking for equality.
"It is the mark of an educated mind to be able to entertain a thought without...
Alright, thanks for the response Dan. I was just wondering if the poster had any problem in implementation .
"It is the mark of an educated mind to be able to entertain a thought without accepting it." - Aristotle
You could use a function like this to find all elements with a certain string in the id:function getElementsWC()
{
els = new Array();
if (arguments[0].indexOf("*")==-1) return document.getElementById(arguments[0]);
else {
for (x=0;x<document.getElementsByTagName("*").length;x++)
{
if...
Just curious, what exactly was wrong with my solution?
"It is the mark of an educated mind to be able to entertain a thought without accepting it." - Aristotle
I thought for sure I tested this earlier without success, but it seems like its working now:
window.opener.document.forms[0].elements['lastname'].setAttribute("readOnly","true");
hope that does it for you.
"It is the mark of an educated mind to be able to entertain a thought without accepting...
You could use something like this:
<script type='text/javascript'>
scrollInt = '';
vScrollDist = 2; //pixels to scroll window vertically
scrollTime = 2; //milliseconds between scrolls
sUntil = 0;
origScroll = '';
function doScroll(until)
{
if (!origScroll) origScroll =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.