279 Posted Topics

Member Avatar for letlet_pogs

The most common mistake ever made in this forum: AJAX is not a programming language, it is a set of javascript functions that allow you to send/retrieve data to pages when the page is already loaded. And, for the thing you want, no AJAX is needed: just regular javascript will …

Member Avatar for letlet_pogs
0
79
Member Avatar for karin42
Member Avatar for gamestoenjoy

Your AJAX request has not yet been processed yet, use the following: [CODE]function init(){ myRequst = new XMLHttpRequest(); var url = "http://localhost/dummy.php"; myRequst.open("get",url); myRequst.send(null); ajax.onreadystatechange=function(){ // If everything is OK: if ( (myRequst.readyState == 4) && (myRequst.status == 200) ) { // Returns the value in a alert box var …

Member Avatar for gamestoenjoy
0
368
Member Avatar for pac-man

I would first advice that you write the HTML code (or generate it in php). Then, when the page is shown properly, you start writing the AJAX-based functions one by one. This is to prevent that your code doesn't work and that you have no idea where it all went …

Member Avatar for kvprajapati
0
135
Member Avatar for anuj_sharma

A long length password contains a few characters. The bigger the amount of characters, the more time it takes for a brute force hacker to gain acces to your website. Definition of brute force hacking: trying out all the different combinations that are possible. When a password is long and …

Member Avatar for Graphix
0
72
Member Avatar for SKANK!!!!!

If the page is loaded, all the javascript scripts have been read and executed. You can only call the functions that have been read. When you use AJAX to change a innerHTML into whatever you want, the javascript of the innerHTML is not executed. So no, you can't. By the …

Member Avatar for Graphix
0
90
Member Avatar for doforumda

You can just make 1 general function that needs a parameter named "page". I made the following code snippet for you: [CODE] window.onload = initAll; var xhr = false; function initAll() { if(window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else { if(window.ActiveXObject) { try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } …

Member Avatar for Graphix
0
88
Member Avatar for gizmocreations

I also looked through the results of "Genie Scroller" with Google, and also found out there are no other scripts that works like the one Adobe made. Perhaps you should contact Adobe via E-mail, asking wether you could still purchase their product, although it has been discontinued? I also saw …

Member Avatar for Graphix
0
79
Member Avatar for venus_me11

First of all: seats are usually displayed as squares. It so happens to be that table cells are also squars. Thats why it's so easy to use a table to show seats. If you want a more realistic map of a bus, you will first need to make a ground …

Member Avatar for Graphix
0
82
Member Avatar for girl.java

General: >> Line 2 and 29 Dont use caps for elements or attributes, use lower case: [icode]<script type="text/javascript"></script>[/icode] >> 28/29 There is a mismatch, the script tag needs to be closed before you close the html tag. [COLOR="Red"]This is wrong: <b><i></b></i>,[/COLOR] [COLOR="Green"]this is correct: <b><i></i></b>[/COLOR] >> A script needs to …

Member Avatar for girl.java
0
88
Member Avatar for jazzybabe

I think you should use flash for this. I don't have a clue how to make 3d models in javascript (if it is even possible). However, a slideshow of images is possible. Visit the following link for an example: [URL="http://www.daniweb.com/forums/thread251289.html"]http://www.daniweb.com/forums/thread251289.html[/URL] ~G

Member Avatar for Graphix
0
60
Member Avatar for filch

Could you post how the form is displayed within the source code, due to the fact that it would be easier to test the javascript code for ourselves. ~G

Member Avatar for filch
0
120
Member Avatar for jfrojasdelrio
Member Avatar for azegurb

A few modifications should be made to your code: >> Each codeline needs to be ended with a [icode];[/icode] >> Line 15 - You forgot to add the script-type, it needs to be [icode]<script type="text/javascript"> [/icode] >> Line 20 - Each time the function gets called, the step gets set …

Member Avatar for azegurb
0
243
Member Avatar for shiv0013

>> Line 4 and 6 - you declare the variable's name as [ICODE]confirm[/ICODE], but you use the the variable name [ICODE]confir[/ICODE] in the script. >> Line 21 - [ICODE]=== [/ICODE]needs to be [ICODE]==[/ICODE] ~G

Member Avatar for shiv0013
0
91
Member Avatar for vipin saxena

I currently use Javascript and XHTML for clientside and PHP for serverside. (AJAX is something in between). PHP and Javascript are easy languages in comparison to VSC++, C++, C and Java. The biggest difference is the you don't have to declare what type (int, char etc...) variables are. So I'd …

Member Avatar for vipin saxena
0
97
Member Avatar for SKANK!!!!!

You can just use a function that calls different functions, example: [CODE] <script type="text/javascript"> function sayHi() { alert("Hi"); } function sayHello() { alert("Hello"); } function callHelloHi() { sayHi(); sayHello(); } window.onload = callHelloHi(); </script> [/CODE] ~G

Member Avatar for SKANK!!!!!
0
188
Member Avatar for girl.java

I tried out the program you wrote yourself, and it returns the uneven numbers, what is there to solve? If you would like the program to be re-useable without refreshing, calculates the even and uneven numbers and their sums you could try the following: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML …

Member Avatar for harrierdh
-1
115
Member Avatar for Stefano Mtangoo

You should first create a function that validates the input values, it returns true when they are all filled in and false when not. If you would also like to check wether they are according to a certain pattern (for example email [email]xxx@xxx.xx[/email]), you could extend the function I wrote …

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for ytregnn

You should make 2 functions: - [ICODE]ShowObject(objectId)[/ICODE] - [ICODE]CloseObject(objectId)[/ICODE] And two global variables: [CODE]var maxHeight = 300; var curHeight;[/CODE] [ICODE]ShowObject(objectId)[/ICODE] sets a Interval of for example every 20 miliseconds in which he calls itself again. Each time the function gets called it increases the height with 3px. If the maximum …

Member Avatar for Graphix
0
89
Member Avatar for mriain

You should do the following: - Create a function that needs one argument, which is the id of the input. - The function retrieves the value using [icode]document.getElementById(id)[/icode] and then adds the part of text you want on the end. - Then you update the value of the input with …

Member Avatar for Graphix
0
82
Member Avatar for garyi1308

Perhaps you should calculate a random number with javascript, between 0 and the amount of different videos you want to display. Then you should use a switch to decide which number corresponds with what source, for example: [code] var randomNumber = 0; // This you need to decide with a …

Member Avatar for Graphix
0
72
Member Avatar for thebluestar

>> Line 13 - You forgot to add the {} at the else. You should always use an if...else the following: [code] if (...condition...) { } else { } [/code] >> Line 14 - Never use a document.write() in a function you call when the page is already loaded. Use …

Member Avatar for almostbob
0
125
Member Avatar for thebluestar

>> Line 4 - [icode]<script type="text/javascrip">[/icode] needs to be [icode]<script type="text/javascript">[/icode] ~G

Member Avatar for Graphix
0
92
Member Avatar for ryan1987

>> Always put code in code tags: [code] function Length_TextField_Validator() { // Check the length of the value of the teamname and teammanager if ((addteam.teamname.value.length < 3) || (addteam.teamname.value.length > 20)) { // alert box message mesg = "You have entered " + addteam.teamname.value.length + " character(s)\n" mesg = mesg …

Member Avatar for Graphix
-1
81
Member Avatar for Graphix

Hi, I am currently learning C#, but when I made a program that allows the user to guess a word (in Dutch that's called "Galgje") it repeats the while-statement twice, ignoring the scanf(). I searched with Google and found out that the program is too fast for the user input. …

Member Avatar for Graphix
0
233
Member Avatar for Daniel_Crouse

I made a small sample code on how to do this: [code] <script type="text/javascript"> function changeAction(formid, actionvalue) { document.getElementById(formid).action = actionvalue; } </script> <form action="formhandler1.php" id="form1"> <input type="button" onclick="changeAction('form1', 'formhandler2.php')" /> <input type="submit" value="submit" /> </form> [/code]

Member Avatar for Daniel_Crouse
0
89
Member Avatar for handyman_uk

I visited the site, but it doesn't go nuts in any browser (I have all 5 leading browsers (ff, ie, opera, safari, google chrome) on my computer). Perhaps you should update firefox to 3.5.6? ~G

Member Avatar for handyman_uk
0
121
Member Avatar for E-AN

You should try the following: - Add an id for every input and form - Write a global function that checks the value (for example [icode]check_email(inputid)[/icode] or [icode]check_name(inputid)[/icode] ) - Use the event [icode]onsubmit()[/icode] in each form tag. In that event you should call a fuction: [icode]onsubmit="return checkform(this.id)"[/icode] - The …

Member Avatar for Graphix
-1
116
Member Avatar for michelle1

[URL="http://www.google.com/#hl=en&source=hp&q=geometric+library+c&btnG=Google+Search&aq=f&aqi=&oq=geometric+library+c&fp=b36c7832dbb01be6"]Google[/URL] first before you start posting. The number one result at Google is a geometric library named [URL="http://www.cgal.org/"]CGAL[/URL]. ~G

Member Avatar for michelle1
0
89
Member Avatar for ruwanaru

This should do the trick: [CODE] <script type="text/javascript"> function toggleVis(id) { var vis1 = document.getElementById(id).style.display; if (vis1 == "inline") { document.getElementById(id).style.display = "none"; } else { document.getElementById(id).style.display = "inline"; } } </script> <input type="checkbox" id="div1chk" onclick="toggleVis('div1');" /> <input type="checkbox" id="div2chk" onclick="toggleVis('div2');" /> <input type="checkbox" id="div3chk" onclick="toggleVis('div3');" /> <div id="div1" style="display:none;"> …

Member Avatar for terrial
0
127
Member Avatar for Tekkno

This should do the trick: [code=javascript] <script type="text/javascript"> var time = 10; //How long (in seconds) to countdown var page = 'ddd.html'; //The destination. var myInterval; function countDown(){ time --; get("message").innerHTML = time; if(time == 0){ window.location = page; clearInterval(myInterval); time = 10; } } function get(id){ if(document.getElementById) return document.getElementById(id); …

Member Avatar for Airshow
0
258
Member Avatar for Graphix

You can place the game "Blackjack" by adding the following script to your website. All the information is included within the script, please do not remove the warranty or information. If you don't want such a big lap of code on your website, you can also place the following, as …

0
472
Member Avatar for Graphix

Hi all, I made a script that can be used as a captcha. It shows a random amount of (roman) letters sliding by every 2000 miliseconds (thats why its called [B]Matrix[/B]Captcha. But I am not sure wether it is able to stop bots from spamming. Does anyone have a suggestion …

0
116
Member Avatar for BlackPhoenix

Hi, try this: [code] var finalArray = new Array; var testString = new Array; testString[0] = "1,Jeremy,130,80;2,Ludwig,370,300;3,Jeancarlos,200,200;4,Luke,330,70;5,Someoneelse1,392,108"; testString[1] = "1,William,110,30;2,Lauren,370,300;3,Sophie,200,200;4,Charlotte,330,70;5,Someoneelse2,392,108"; // You can go on forever with adding strings here.... for (x = 0; x < testString.length; x++) { var testArray = testString[x].split(";"); for(i = 0; i < testArray.length; i++) …

Member Avatar for Airshow
0
125
Member Avatar for Graphix

This script can be used for star ratings on for example forum or music sites. The scriptinformation is included within the script. ~G

2
422
Member Avatar for dmmajorstudent

Well, I don't quite know what you don't understand, neither do I know why you should use innerHTML when creating a input in which you can enter your phonenumber. Try the following? [code] <script type="text/javascript"> function is_numeric(mixed_var){ return (typeof(mixed_var) === 'number' || typeof(mixed_var) === 'string') && mixed_var !== '' && …

Member Avatar for dmmajorstudent
0
183
Member Avatar for samarudge

My suggestion: [code] <?php function encode_num($number) { switch($number) { case 1 : return "a"; break; case 2 : return "b"; break; case 3 : return "c"; break; // ... Alot of code... // ...Here comes all the other options... // ...Alot of code... default: return "Invalid number"; break; } } …

Member Avatar for samarudge
1
113
Member Avatar for Graphix

Hi all, I am currently having a small problem with my Windows XP computer: when I am for example playing Call of Duty 4 or Age of Mythology, the computer minimalizes the window by itself every half hour (or something like that). It doesn't happen with browsers or other applications. …

Member Avatar for Graphix
0
224
Member Avatar for sdgundamuse

Try this: [code] $error = array(); $results = array(); if (isset($_GET['search']) && isset($_GET['field'])) { $searchTerms = trim($_GET['search']); $searchTerms = strip_tags($searchTerms); // remove any html/javascript. $searchField = trim($_GET['field']); $searchField = strip_tags($searchField); $searchField = addslashes($searchField); if (strlen($searchTerms) < 3) { $error[] = "Search terms must be longer than 3 characters."; }else { …

Member Avatar for sdgundamuse
0
146
Member Avatar for vishalonne

Hi, there are a few things wrong with your code, it seems like you dont understand the difference between a name and an id. An id is unique, a name is not. You can not retrieve a name with getElementById(). The following code will work in all browsers: [code] <?php …

Member Avatar for Graphix
0
117
Member Avatar for catfleamassacre

I don't know whether this is the best solution, but here it is: [code] <?php // Note: this MUST be on the top of the page, without any whitespace whatsoever infront of it session_start(); ?> <?php $theimagename = "05-5098-40293050.jpg"; // You have retrieved this from your upload script $_SESSION['imagename'] = …

Member Avatar for muralibobby2015
0
153
Member Avatar for Rblalock

First of all: it doesn't seem like you have had alot of experience with regular XHTML and as so don't know how a form works. If you would like to have a form that is submitted to another page and has a reset button, use something like this: [code] <form …

Member Avatar for Graphix
0
118
Member Avatar for abhymax

Hi, you can try this: 1. Make 2 images using a image editor (PhotoShop or something like that), one is a bit darker as the other (for example: darkImg.jpg and lightImg.jpg) 2. Use the onmouseover and onmouseout events to show the lighter version when someone scrolls over and the darker …

Member Avatar for abhymax
0
87
Member Avatar for cwarn23

A few suggestions: - How to debug your code - How do you use an include() and how do you acces files beneath the webroot? - How do you secure your site, what techniques can be used and what shouldn't you do. - When should you use sprintf(), printf(), print(), …

Member Avatar for cwarn23
4
648
Member Avatar for crebilis

It doesn't work in IE because you have neglected to add doctype and such. I also think the script is not very well written.... Here is a better one: [code] <!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" xml:lang="en" lang="en"> <head> <title>Formtest</title> <script type="text/javascript"> function clearElement(id) { document.getElementById(id).innerHTML …

Member Avatar for Graphix
0
166
Member Avatar for DaveyMoyes

Try this: [code] <script language="JavaScript" type="text/JavaScript"> <!-- menu_status = new Array(); function showHide(theid){ if (document.getElementById) { var switch_id = document.getElementById(theid); if(menu_status[theid] != 'show') { switch_id.className = 'show'; menu_status[theid] = 'show'; set_cookie(theid,'hide'); }else{ switch_id.className = 'hide'; menu_status[theid] = 'hide'; set_cookie(theid,'show'); } } } function showHideAll() { var menuState = get_cookie ('mymenu1'); …

Member Avatar for DaveyMoyes
0
259
Member Avatar for wayz1229

Why would you use 2 tables for the exactly same purpose? Why don't you just make the following two table: table "surveyresults": qa_id INT(9) AUTO_INCREMENT NOT NULL, question CHAR(255), answer LONGTEXT, sid INT(9) NOT NULL, And use the following code: [code] <?php require_once('auth.php'); require_once('config.php'); // // Retrieving which survey it …

Member Avatar for Graphix
0
151
Member Avatar for Graphix

I am currently having a problem with my BB-code editor, like most things it works great in FF, but i have an issue with IE: whenever i select a word that has already been previously typed, it selects that word instead of the one i selected. Here is the selection …

Member Avatar for Airshow
0
285
Member Avatar for Jayakrishnan_gk

You can replace strings doing so: [code] <script type="text/javascript"> var query="Wat is the question?"; query = query.replace(/?/, ""); </script> [/code] Visit [url]http://www.w3schools.com/jsref/jsref_replace.asp[/url] for more information ~G

Member Avatar for Jayakrishnan_gk
0
154

The End.