~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Not possible on the client side, you would have to use server side routines to preserve the values entered by the user once the form has been submitted.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You need to access the element value by using the ' value ' property of the form element. The document.getElementById() function returns an Element , not it's value. Do something like:

var value = document.getElementById('txt' + i).value;
if(value == '')
{
  //do something
}

Just keep in mind that this kind of validation won't hold water if the user inserts multiple spaces in the field and submits the form.

Also the correct way of accessing form elements would be document.forms['frmName'].elements['elementName'].formProperty .

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

It would be nice if you could share your knowledge with others out there by posting the code in consideration in the code snippets section.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

When written above the form, the script tries to access an element which isn't there i.e. since the form hasn't been yet created, there is no form element whose fieldname you can access. When written below, it obviously works as expected.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Look into the createElement and appendChild functions of DOM to achieve your task.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

s = fso.CreateFolder("C:\Documents and Settings\Default\Desktop\test.txt", true); has incorrect escaping. You need to escape the \ character. Do something like s = fso.CreateFolder("C:\\Documents and Settings\\Default\\Desktop\\test.txt", true); though this is not a recommended approach.

Replace window.location = "Alex_main.html"; with window.location.replace("Alex_main.html"); assuming that the file resides on the same path as that of the current file.

As far as persisting the state is concerned, use cookies if you are doing this client side, though it beats me why you would do password validation on client side.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

There seems to be some sort of error in your XML file. What happens when you double click the file and try to open it up in a browser? If it doesn't open up, there is some problem for sure. Paste the XML file here wrapped in code tags and properly indented and we will see what can be done.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Use the replace function of the location object.

Try top.frames['bottom'].location.replace(bottomURL); or top.frames['bottom'].location.assign(bottomURL);

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

It depends a lot on the format in which the times are expressed. Post some code so that we have something to chew on.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> pure object oriented
Java is not a true OO language. If you are looking for pure OO, look into Smalltalk and Ruby in which everything is a class and all operations are messages to objects. Read this.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
String query = "UPDATE Grades SET  " +
 "FirstName='" + fields.first.getText() +
 "', LastName = '" + fields.last.getText() +
 "', Quiz1 = '" + fields.Quiz1.getText() +
 "', Quiz2 = '" + fields.Quiz2.getText() +
 "', Quiz3 = '" + fields.Quiz3.getText() +
 "', MP1 = '" + fields.MP1.getText() +
 "', MP2 = '" + fields.MP2.getText()+
 "', FE = '" + fields.FE.getText() +
 "' WHERE id=" + fields.id.getText();

Considering that the "id" is a string, you are missing a single quote around it. The query should look like:

String query = "UPDATE Grades SET  " +
 "FirstName='" + fields.first.getText() +
 "', LastName = '" + fields.last.getText() +
 "', Quiz1 = '" + fields.Quiz1.getText() +
 "', Quiz2 = '" + fields.Quiz2.getText() +
 "', Quiz3 = '" + fields.Quiz3.getText() +
 "', MP1 = '" + fields.MP1.getText() +
 "', MP2 = '" + fields.MP2.getText()+
 "', FE = '" + fields.FE.getText() +
 "' WHERE id='" + fields.id.getText() + "';";

But like it has been already correctly mentioned, use PreparedStatement instead. Also read up on the Sun JDBC tutorials to get a hang of things.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> what the hell is wrong?
You should be the one telling us that. I would be surprised if something like this post even got answered.

Just telling that things _don't_ work isn't helpful for anyone. That all being said, you should at least find out if this problem is a PHP one or a Javascript one, post the exact nature of the problem, the expected output and the output you are getting. Plus posting a code with no indentation is an instant repellant.

Try isolating the cause of problem and if it's a PHP one, re-frame the question and post it in the PHP forums.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Take a look at the functions provided by the Date object of Javascript and try your own hand at it. Post your attempt with the problems you are facing if you are stuck.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> top.bottommenu.document.location.reload(); It should be top.frames['bottommenu'].location.reload(); . location is a property which belongs to the window object and not the document object. Plus you are confusing others by pasting two functions with the same name and different function definitions. Be a bit more concise and clear the next time.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Is this possible?
Yes, very much possible. Use the DOM API. Below I present a minimalistic code snippet which replaces a button element with a text element.

<html>
<head>
<script type="text/javascript">
    function change(elem)
    {
        var newElement = document.createElement("input");
        newElement.type = "text";
        newElement.id = "txtName";
        newElement.name = "txtName";
        elem.parentNode.replaceChild(newElement, elem);
    }
</script>
</head>
<body>
<form action="#">
    <input type="button" name="btn" id="btn" value="Change on click" onclick="change(this);" />
</form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Is it possible to make a c++ game?
Commercial games are almost always made in C++ with the game scripting done using scripting languages like Lua and Python. This isn't a surprise considering performance is of prime importance. Also read this.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Still eating food and drinking water.

Chaky commented: I should ask you he same, he he. I guess it qualifies as "food". +4
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You must be using IE. IE is famous for running and supporting all that is 'non-standard'. That behavior is not guaranteed for all browsers. Post your code if you still have queries.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I have updated my previous post with links, read those.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Javascript executes on the client machine. The thing you are trying to do involves server side interaction. Either fetch the entire Google Homepage as plain text using Ajax's 'responseText' or do it pure server side and generate the entire HTML on fly.

There are a lot of 'Eeek' things in your code. Keep in mind that 'document.write()' is evil. Also the language attribute of <script> tag is deprecated. Use <script type="text/javascript"></script> instead. document.all is IE only and not W3C compliant. Instead of that use document.getElementsByTagName("a") (notice the lowecase 'a'). And its ' onclick ' and not ' onClick '.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> i would like to avoid rediracting to the file css
What do you mean by 'redirecting' to the CSS file? The markup you wrote 'links' to an external CSS file. If you don't want to, just remove the line or comment it. Plus the way you provide your 'href' is wrong since "\C" is an illegal escape character and your HTML file would never be able to find the stylesheet and it's a bad practice to use absolute paths. Use relative paths. <link rel="stylesheet" type="text/css" href="./css/Globals.css" />

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> How can I get certain html text input fields to appear disabled, and the text that's inside
> un-editable or unchange-able?
You have got to realize that 'disabled' doesn't mean or equate to 'readonly'. Both these properties disallow the user from editing the entered text but the real difference comes when you try retrieving the form element values at the server. If the element is marked with the property 'disabled', the form element value won't be submitted to the server while a form elements' value marked 'readonly' will be. <input type="text" name="txtName" id="txtName" readonly="readonly" /> <input type="text" name="txtName" id="txtName" disabled="disabled" />

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> He made Boo mad. He should apologize. He was insulting, not funny.
Agree with you on all counts, that _was_ mean. Plus lack of apology makes it look even worse. It's a pity many people take apologizing an inferior act... :icon_frown:

Sulley's Boo commented: *hugs him real tiiiiiiiiiight* :D +3
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You are assuming smooth execution. What happens if the browser is closed when taking the exam? What happens when the user refreshes the page? You need to maintain the user state as well as the time of the examination in the user session. Keep the involvement of Javascript in business logic to its minimum.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The 'setAttribute' function doesn't scale well with all the browsers. You need to use the direct property manipualation technique for your code to be cross browser compatible. img[p].title = 'Click to enlarge image'; If it still doesn't work, there is a possibility of an error occuring before the given line.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yes, someone please smear some cake on Chaky's face. ;-)

Chaky commented: *Takes the cake, sneaks behind him and gives him a cake-slap-in-the-face from behind*.... you have some too, hehe +4
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Not to mention on a slow internet connection the entire images are downloaded, displayed in their full dimensions and then resized only when the document is _entirely_ loaded (onload will be called only when all the images are downloaded).

Like Matt already mentioned, consider shrinking the images on the server side to save on the client bandwidth and the weird behavior. Better yet, cache the images which have been shrinked or store the shrinked images in a separate location / database table to achieve time efficiency traded against space.

> can we do away with the requirement for an alt attribute altogether? so any image posted in img
> tags will work?
It all depends on the way you are associating your images with the post under consideration. As soon as the user attaches images and posts, the data is sent to the server. The kind of processing you do at the server and the way a post is rendered decides it all.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Eating food and drinking water.

Sulley's Boo commented: are wah! hum samjhe ke tu lokhand khata .. demagh jo itna taiz hai :P +3
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Maybe something like this.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I am assuming here that you are talking about your Java application. When starting the application, bind it to any port which is not currently in use. That way when you try to create another instance of your application, you would get a socket exception saying that he port is already in use.

Something like:

import java.net.*;
import java.io.*;

public class SingleApplicationInstance
{
    public static void main(String args[])
    {
        try
        {
            ServerSocket ss = new ServerSocket();
            ss.bind(new InetSocketAddress(100));
            System.out.println("Application started");
            Thread.sleep(1000000000);
        }
        catch (SocketException e)
        {
            System.out.println("Application already running");
            System.exit(1);
        }
        catch(Exception e)
        {
            System.out.println("Application encountered some problem.");
            System.exit(1);
        }
    }
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

What would you achieve by serializing a window handle which is valid only as long as the window exists?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> If you don't declare a variable as being global or local (as defined by where its var
> statement is) the browser has to guess.
Not entirely true. There are two types of variables in javascript -- global scoped variables and function scoped variables. There is no block scope in javascript.

The var declarations only make sense inside a function though it't not illegal to preprend the same when declaring global variables. The browser doesn't need to guess anything. Anything prepended with a 'var' inside a function is a local variable, all other variables are globals except in the case when you declare you own namespace i.e. object literals.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> but shutting people down entirely is highly discouraging.
Losers always crib, those interested ask sensible questions and winners pave their own way.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Sitting in the dark corners of my house doing nothing requries a lot of craft...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I know this is a little late, but if you live in the US, switch to law and join the money making crowd. In your present technical field you will always be just a peon competing with low paid labor from India or China.

If you are the best, nothing prevents you from being what you want to be / achieving what you want. Of course, if someone is a lazy potato who somehow manages to get a 'engineering' degree by stealing someone elses' work, he deserves to be a peon.

Sulley's Boo commented: riiiiiiiiight! +3
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Serialilzation is solution to your question.
Serialization is a completely different beast. In serialization, you serialize i.e. persist an object onto the secondary storage and read them again as and when required. Here the user is presented with a simple text file so the only option is to read the file using the File streams or readers and parsing the content as required.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> I'm a programming newbie starting to study VB and, like many others, I wonder if this
> is the best language to learn.
Absolutely no. There are better languages out there like Java, Python etc.

> then I could judge the capabilities of each and decide which is right for me
You don't decide the merits of a programming language based on whether it generates and executable or not!!

> I think it would be educational to study the source code of other programs.
As far as learning from others' code is concerned, head over to sourceforge which is the home of numerous open source projects out there, just pick up your favorite programming language project and start studying / contributing.

> How can I determine the programming language of an .exe file? And how can I view it?
AFAIK, you can't, in both of the cases.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Python is used in a lot many games. Severance - 'The Blade of Darkness', 'Freedom Force' and so on. The scripting language Lua has been used in both the original and the expansion of 'Painkiller'. Search up those and you will see these really are famous games.

The point here is that you might and should use scripting if it simplifies application development but the time when they would be used to code the time critical logic is yet to come...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I disagree. Even after all these years, Java still has to go a long way when compared to C++, at least in terms of Game Development. The kind of raw power achieved by C / C++ _can't_ be offered by Java.

Compare and contrast the implementation of different languages in C and Java and you would know what I am talking about (Rhino v/s SpiderMonkey). Although this _slow_ term isn't really justified in normal application development, it stands out when developing games. Plus the inclination of the industry to still use C as the core language to develop the game / graphics engine, regardless of what they use for scripting is enough proof in itself.

But I don't question the theory that the future holds a lot for newer langauges like Java, Ruby, Python but that time is yet to come.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> a theoretical global setting like 'open popups as tabs' could defeat any attempts to hide
> the backbutton without directly 'disabling' popups
You are missing the most important point of this discussion. Users of intranet applications don't try to _get around_ these applications. Suppose you have an intranet application at your work place in which you can check you attendance, your salary slips and all such things related to you, would you still block the popups or try to hack things?

Also if you want to go in nitty gritty details, every action performed on an intranet is almost always logged and monitored. Of course someone who is hell bent on destroying or deliberately hacking the application, there is no stopping it.

I am not saying these things just because I think they should be the way I am saying it, I have seen these things in action, and not one but many. Like I said before, client requirements vary. Would you deny removing the toolbar even whe the client asks for it, yes?

> if you can't assume a browser/OS of choice, you certainly can't assume a configuration of choice.
How about a requirement from client like, "We need this intranet application to work on all OS'es and we don't want to incur extra cost by buying proprietary tools. Oh and please, no custom applications." Plus this what The Web is all about, making applications which run on multiple platforms.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I guess the OP is making some kind of quiz site wherein he doesn't want the user to switch to the previous questions. In that case, implementing this using the server side language of one's choice is the best possible way, IMO.

> It's a naive and unreliable means for restricting or controlling any part of an underlying application.
Yes, I guess that's what I said in my previous post.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Wouldn't have to VB, could be C++ et al since the control's an ActiveX, and the same principle applies to all OS that package commonly used components/objects/etc. I was using VB as an example. Could even be done in Java, although not easily.. Alternatively, modify a Firefox version, it's opensource and multiplatform ( maybe write once compile anywhere? no idea ). Intranet implies internal, and companies often control the software on their employees machines.

All those things would be quite a PITA and I really mean _quite_. Java, yes can be done, but feasible, never. Active-X again MS proprietary. C++, zero feasibility, at least when my ultimate aim is not making a browser. All the options are too much just for disabling a back button or increasing the display area by removing the toolbar.

The popup window method will only work if the browser allows popups, and there's nothing to stop a user re-enabling the toolbar on a popup, or accessing the page without following a path that invokes the popup (i.e direct URL ) still, it's probably a better solution than writing a new browser frontend just to disable 'back'..

Intranet applications almost always run in trusted zone so popups won't be a problem unless you specifically plan on disabling them, though it doesn't make any sense as to why someone would disable an intended feature.

I still can't imagine a good reason to disable back.

Increasing the display area, restricting user navigation, giving the feel of …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You need to have a basic understanding of Javascript objects for understanding the solution presented below:

Test.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel = "stylesheet" href = "Styles.css" media = "all" type = "text/css" />
<title>sample page</title>
</head>
<body id = "myBody">
    <noscript>Your browser doesn't support javascript. Be prepared for broken site functionality...</noscript>
    <form id = "myForm" action = "">
    <div id = "myDiv">
        <fieldset>
        <legend>First</legend>
        <input type = "checkbox" name = "first" id = "first" value = "1" /><label for = "first">One</label><br />
        <input type = "checkbox" name = "first" id = "second" value = "2" /><label for = "second">Two</label><br />
        <input type = "checkbox" name = "first" id = "third" value = "3" /><label for = "third">Three</label><br />
        </fieldset>
        <br /><br />
        
        <fieldset>
        <legend>Second</legend>
        <input type = "checkbox" name = "second" id = "four" value = "4" /><label for = "four">Four</label><br />
        <input type = "checkbox" name = "second" id = "five" value = "5" /><label for = "five">Five</label><br />
        </fieldset>
        <br /><br />
        
        <fieldset>
        <legend>Third</legend>
        <input type = "checkbox" name = "third" id = "six" value = "6" /><label for = "six">Six</label><br />
        <input type = "checkbox" name = "third" id = "seven" value = "7" /><label for = "seven">Seven</label><br />
        </fieldset>
        <br /><br />        
    </div>
    <input type = "submit" value = "Check validity" id = "btn" onclick = "SOS.validate('myDiv');" />
    </form>
<script type = "text/javascript" src = "Lib.js"></script> …
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> backbutton-neutered IE6. Distribute to everyone onsite.
Being Intranet doesn't mean we can assume that all the clients would be using the browser / OS of our choice, not to mention you already included a proprietary software there by mentioning VB. Basically there are several contributing factors, the clients' requirements being the most important of them all. The popup window method will work for all browsers.

> In any context, including Intranet applications, why should 'back' ever need to be disabled?
Crazy clients, crazy requirements.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Look at the error console of Firefox or get a debugging tool like Firebug to ease your Firefox development.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The annoyance with the 'Back' button, I fear is not universal. There are cases (read Intranet applications) where the client has requirements for the web application to look like a desktop application, making the removal of toolbars necessary.

BalagurunathanS, the only way to disable the back button is to remove the entire toolbar in the way mentioned by Midimagic in his previous post.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Look into the document.createElement() function which creates new DOM elements based on the passed parameter. Also look into the DOM select and DOM option objects.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

What's right with the round ones? ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> From your phrase i consider that you don't know anything from graphics.h
You are correct, I don't use kiddie stuff unless forced to do so. Real people use real graphics API like OpenGL and DirectX.

Sturm commented: lol "real people use real graphics API" +2