Basically I'm going through and renaming div id's, etc to manipulate later in functions.I'm using jQuery's detach() which is working but for some reason my while (now for loops) are not working and providing me with bogus numbers.
Code:
var arrayFights=[0,1,2,3,4,5,6,7,8];
var counter = theBox; //where to start in the array
//first change numbers larger than counter
for(i=1;i<fights;i++){
arrayFights[counter] = i;
counter++;
I'm probably missing something simple here. I have this function called display:
function display(name3,office3,officePH3,mobile3,email3) { document.getElementById('viewer').src=('Location_Files/')+(office3)+('.htm') }
It's supposed to take 5 values and do various things with them. When I only had one parameter it worked fine, it took an office number which was the value of a listbox option and turned it into a path and then pointed an iframe to that path. Then I changed it so the value of the listbox option was 5 parameters separated by commas. Here's the listbox now:
You can see display is executed as "display(this.value)" so in theory it should take "test name,1656,phone,NONE,email" as its parameters and it should accept 1656 as the "office3" parameter. For some reason it's not working out that way, the function executes and the iframe changes but I get an unable to display webpage message like the path is broken. Can anyone see what I'm doing wrong?
This is a really strange problem i noticed today when adding the last screen into my DHTML app. When i click on a button to hide all of the existing <DIV> tags, and to display the one that i want to currently use. It is doing this, but for some reason or another, it is only being shown for a brief second. and then going back to the main screen. I think this is very strange because there is no event present that should be triggering this to happen. There's not even any code to 'fall through' and inadvertently trigger this, as everything is in different functions.
So here's my code:
The first Javascript file (controls the visibility and hidden aspects of all the <DIV>s)
I also attatched the HTML and the 2 JavaScript files to this message.
I have a small textfield input and submit button. The user is required to input the prefix of their UK postcode and a dialogue boxpopsup saying basically yes or no. My problem is I have an array of postcodes, but if for example someone in Liverpool entered their postcode as L1 1AA, it would say 'yes' but if their mate who enterd in L12 1AA, it would still say 'yes' but it should say 'no'. L1 should be true and L12 should be false. Also to mix things up a bit. I have now been asked to creat a third 'if',if a user enters a code of JE (and then any suffix after ie. 1, 2, 3, 4 etc.), could this be made to say 'unavailable' or some sort.
On some pc's in IE my website shows disbehaviour with the popup-menu. When your mousepointer hoovers over the transparent border, the popupmenu disappears. Please check URL.... Perhaps if you visit the website with Internet Explorer you can see what I mean, but it might be showing good as well.The menu is made with very little javascript and mainly CSS. I discovered the begin of the cause: when I don't use a transparent color for the border, it works fine. Also when I remove the underlying image (the sky-image) and still use transparent color it also works fine. How can this be? Using Z-index for the popup-window/menu and give it a real high number won't work. I really don't see it. Ofcourse I want to keep using the transparent color and the underlying image.[code]
I have a web page that tracks clicks on certain hyperlinks. I am using attachEvent() to attach to the document onClick handler, for IE browsers. It works fine, except that for about 1 out of every 6 clicks, I get 2 to 4 click events for a single click. I know this because each time the hyperlink is clicked, I write a record to a MySQL database. I write the record to the database by setting the SRC property of an IFRAME on the page, to a tracking script.
If I look at the database, for 1 out of every 6 clicks, I see 2 to 4 records for the same click event (occassionally as many as 6 records). They are at least 1 second and at most 7 seconds apart from each other.
What's supposed to happen is when the program is run the user clicks on "Select your Numbers!" their then asked for 5 numbers which they input and then the numbers are checked by a function called �isAlreadySelected� for duplicates and if there is an alert is shown. When 5 numbers are entered correctly then they are shown by a window.alert.
Its done in to 2 functions
When I run the below code I'm prompted for the 5 numbers but it isn't checking for duplicates and my selection is undefined.
And my question is how to make it display error if I have entered letters in the age box or numbers in a name box? Currently I have only if it is different from 1, so what should I write instead of 1 ?
I've got my code, and the task is to generate two random numbers, the user then inputs an answer for them added together, then the program checks the answer and displays either "correct" or "wrong". Here's some of my code:
Code: <HTML> <TITLE>Assessment Task 3 : Rohan Gardiner</TITLE> <HEAD> <SCRIPT LANGUAGE ="JavaScript"> function maths(){ var response; var answer; answer = document.questions.answer.value; if (answer==document.adding){ response = "correct"; } else { response = "wrong"; } document.questions.result.value = response ; } function randoms() { rndNum = Math.random(); Num = rndNum*20; Num1=rndNum*10 document.write(Math.round(Num)+"+"+ Math.round(Num1)); } function adding() { document.write(Math.round(Num) + Math.round(Num1)); } </SCRIPT></HEAD><BODY> <h1 align="center">Rohan Gardiner Assessment Task 3</h1> <FORM NAME = "questions"> <SCRIPT Language=JavaScript> randoms(); </script> = <INPUT TYPE = "textbox" NAME = "answer" > <BR> <INPUT NAME = "dobutton" TYPE = "button" Value = "check" onClick= "maths()"> <INPUT TYPE = "textbox" NAME = "result" > </BODY></HTML>
This sci calculator listed in [URL] has Round function which rounds the result to a nearest integer. I wonder if it possible to easy modify it so that it would leave two numbers after decimal point when it perform rounding? The calculator's script has these codes related to Round: <INPUT style="WIDTH: 74px; HEIGHT: 31px" onclick="Round()" type=button size=24 value=Round> And function Round() {form1.display.value=Math.round(form1.display.value);} I tried {form1.display.value=Math.round(form1.display.value,2);}, but it did no do it.
I've been messing with this code for about a couple of hours, and I did everything down to the wire..yet still I am unable to get it to work. When I input the numbers, and click off to the side nothing appears down at the final textarea of the form which is suppose to show the average.I've tried just about everything, sadly all I have to go by is other example codes, and the very intricate instructions which states I must pass the values to the calcAvg() to the second function of performCalc(), which I did, and then I assigned the var calcResult another value. From there I did the return..and after that I'm rather loss as to what to do next to get this code to work, any tips?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
How do i use a function to find the average of the values in an array of numbers passed as argument to a function.(using java script) thank you for your help...
This does what I want; without the operator 'Number' I get a concatination of the various variables (as expected). Is there some way of globally defining all variables as numbers instead of strings?
How do I find the row & column number of the table for a checkbox on its Onclick event
The following HTML sample works perfect in IE. On click of the checkboxes, I am displaying the row number and its column number. How do I manage the same in Firefox? Code:
I have create a spinnrer (numeric up and down field) in my form. Below is the code for it:
Code: <form action="create_session.php" method="post" name="createsession"> <!-- This will post the form to its own page"--> <table cellpadding="0" cellspacing="0" border="0"> <tr>[code]............
Now what my question is how can I get the spinner to only allow numbers to be inputted in the spinner and not letters. Also how can I get it to only allow 2 digits to be entered in the spinner?. I know it will require an if statement but I don't know how to do it.
iwant to ask on how to display the sum of the 20 numbers i allready get the everage but i want to display the sum together of the everage this my code..
I am tring to sort some six numbers..the problem is that it doesnt work when I use "document.getElementById" instead of "document.write() my program is supposed to write six numbers every second..line by line Could you get it work ?