Put whatever the button does in the OnUnload method of the body.
<BODY OnUnload="SameAsButtonClick();">
That is run even when the "x" is clicked.So it should work for you
<!-- :-) ;-) :-) -->
<html>
<head>
<script language="JavaScript">
var ViewedInfo = false;
function CheckIfViewed(){
if (!(ViewedInfo)) {
alert('BAD PERSON, you didnt go where I wanted you to go ... So I will take you there')...
These functions do it, not so simple but its ok
function isInteger (s)
{ var i;
if (isEmpty(s))
// Search through string's characters one by one
// until we find a non-numeric character.
// When we do, return false; if we don't, return true.
for (i = 0; i < s.length...
<!--
Here's some code to create controls dynamically that I found
-->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function createForm(number) {
data = "";
inter = "'";
if (number < 16 && number > -1) {
for (i=1; i <= number; i++) {...
<!-- Questions 1 4 and 6 are wrong
That stuff you said was confusing, but I think this is what you want
-->
<html>
<head>
<script language="JavaScript">
<!--
NoOfChancesAllowed = 2;
NoTried = 0;
function CheckIt(){
NoTried = NoTried + 1;
msg = "";
if...
<!-- Questions 1 4 and 6 are wrong
That stuff you said was confusing, but I think this is what you want
-->
<html>
<head>
<script language="JavaScript">
<!--
function CheckIt(){
msg = "";
if (document.frm1.chk1.checked){
msg +=...
<!-- this is a basic thing but it shows you everything you need to do maths stuff -->
<html>
<head>
<script language="JavaScript">
function DoMaths(){
document.frm1.answer.value=parseInt(document.frm1.no1.value) + parseInt(document.frm1.no2.value)...
Go to this website , it looks like it is what you want.
http://www.vimas.com/server_sdk/pixcolor.htm
Tell me if it is.
I think it only works on pictures though.
Yes ... a question that I can answer :-)
Just swop this line
var tot = ace1 - ace2;
With this line
var tot = parseInt(ace1) + parseInt(ace2);
You were trying to do maths stuff with a string and in JavaScript the thing you use to combine string is + thats why it did what it did.
PART 2
<!--
This way of doing it is cool, because you make your functions return TRUE / FALSE so if the first one fails it doesnt waist time doing the next one and the form is only submitted when both return TRUE
but if you just want it plain
onSubmit="test1();test2();"
that will run...
<input type="text" onchange="alert('change');" onKeyUp="alert('keyup');">
<input type="text" onKeyUp="return autoTab(this, 3, event);"
onChange="setRubriek(this.form);">
That puts both your functions on the text box ...
Hope its...
<!-- This code should help if I understand what you want right.
I didn't write the isEmpty and IsWhitespace functions I got them off a site, can remember which one though.
Thanks whoever wrote them
-->
<html>
<head>
<script language="JavaScript">
<!--
// whitespace characters
var...
<!--
Hi
Run this script, it is a simple version of what you want to do I think, I would explain it but I just started looking at it a few minutes ago, but it doesnt look too bad.
-->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function createForm(number) {
data =...
<!--
It is possible to do this using ActiveX embedded into your JavaScript
It works but it brings up a window asking if you want to run the script because it might be UNSAFE
-->
<html>
<head><Script language="JavaScript"><!--
function WriteToFile()
{ var filename =...
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.