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

> <script type="text/javascript"> getPropertyNum();</script> This just means that you are executing the function getPropertyNum() and ignoring the return value, nothing else. To make sure the value is reflected in the DOM tree, you need to either do document.write(getPropertyNum()) (not recommended) or use the HTML DOM.

A few other things:

  • Don't use tabs for indentation, at least while pasting the code. It makes it harder to read the code. Use 2/4 spaces or use an IDE / Editor which can convert from tabs to spaces.
  • Also paste the accompanying XML file / response so that the people who want to help you out can try running the snippet without having to create their own test cases / sample input.

Revert back in case of more queries.

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

> Otherwise you would have to use the getElementsByName() method to get all the elements
> with the name "states".
Or simply document.forms[0].elements["states"].disabled = false; which is the correct way of handling form elements.

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

> when I try it in IE7, the countdown starts at 9 seconds no matter what.
Works fine for me.

Even though the semicolons are optional in Javscript, it's a good practice to explicitly put them to avoid some subtle bugs.

A better solution would be to use setInterval.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Example</title>
    <script type="text/javascript">
    var t = 10; /* This would come from PHP */
    var decr = 1;
    var handle = null;
    
    function startTimer() {
        var e = document.getElementById("time");
        e.innerHTML = t;
        handle = setInterval(function() {
            if(t == 0) {
                clearInterval(handle);
                window.location.href = "http://www.google.co.in/";
            } 
            else {
                t -= decr;
                e.innerHTML = t;
            }                
        }, decr * 1000);
    }
    window.onload = startTimer;
    </script>
</head>
<body>
    <div>The time remaining is <span id="time"></span></div>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

IE doesn't like setAttribute as already mentioned. A cross browser compatible way of setting the attributes would be to treat them as object properties and modify them directly.

formElement.type = "button";
/* .... */
formElement.onclick = function() {
   someFunction();
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> ???
You would need to use a server side language / API like PHP or J2EE respectively along with some database as backend to implement your project. It can't be done in Javascript along since it's a client side scripting language used to enhance site usability and not provide functionality.[1]

> Note: im a beginner
Then you are attempting something which is way out of your league.

[1]: Of course you can use server side Javascript but that would be a different story altogether.

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

> var obj = eval("document.list_photo." + objId);
Don't use eval. It's like using a powerhouse to light a single bulb. The same thing can be done using var obj = document.forms['list_photo'].elements[objId . The same can be said about the other places you have used eval. Read the Javascript FAQ for more details.

> wat i wan is it jz will display 1.3 not everytime i click the radio button
If you are pretty sure that the format will always be x.y (e.g. 1.4), you can search for a dot(.) at the start of the function and if one is present, skip the remaining function. Or you can set a flag as soon as you are done and skip the function if the flag value is true.

var delim = ".";
var oldv = document.getElementById('photo').value;
if(oldv.indexOf(delim) == -1) {
   /* the remaining function goes here */
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Or you could do something along the lines of
IE has problems with setAttribute. Plus assigning a function reference to an event listener is better than assigning a blank string to it.

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

> Now that has been annoying me and I have been trying to figure out a way to prevent this.
Doing so wouldn't be a good idea unless it's absolutely necessary. Sure you can do it, but it won't be worth the kind of computational complexity it introduces.

Long gone are the days of client side validation. Just do server side validation and you won't have to worry about what the user pastes or writes in the text box.

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

> Using the normal xmlHttp request, it retrieves a html document. But is there any way I could
> actually handle it through some kind of DOM before actually displaying it?
Make sure that the page you fetch using XHR is well formed. If that is the case, you can manipulate the contents of the response just as you would to a normal HTML document.

var doc = xmlHttpRequest.responseXML;
doc.getElementsByTagName("someTag")[0].someAttribute = someValue;

> DOMnode.setAttribute(Node.attributes[i].nodeName, Node.attributes[i]); IE doesn't like set/getAttribute . Use obj.attribute = value; for maximum browser compatibility.

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

What seems to be the problem with the official FlyFF site?

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

> Internet Exploer does not like this method for some reason
Why? What made you reach that conclusion? In fact, my entire snippet for removing the selected option relies on removeChild and it works fine in IE/FF/Opera.

Also a few things to keep in mind.

  • Post the entire code which we can copy and run instead of just the relevant function which in turn requires us to develop a test case.
  • Don't use tabs for indentation, at least when posting code. It makes a mess out of it as you can very well see.

Here is a small snippet which should get you going:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Example</title>
    <script type="text/javascript">
    function doDelete(frm) {
        var sel = frm && frm.elements["selBox"];
        
        /* empty / non-existent select box */
        if(!sel || sel.selectedIndex < 0) {
            return;
        }
        var item = sel.options[sel.selectedIndex];
        var parent = item.parentNode;
        parent.removeChild(item);
        
        /* remove all the text nodes */
        while(parent.hasChildNodes()) {
            if(parent.childNodes[0].nodeType != 3) {
                /* non-text node found, exit the function */
                return; 
            }
            parent.removeChild(parent.childNodes[0]);
        }
        /* since we have reached here, the parent node
           must have zero elements so remove it */
        parent.parentNode.removeChild(parent);
    }
    </script>
</head>
<body>
    <form action="#" name="frm">
    <select name="selBox">
        <optgroup label="Swedish Cars">
        <option value ="volvo">Volvo</option>
        <option value ="saab">Saab</option>
        </optgroup>
        <optgroup label="German Cars">
        <option value ="mercedes">Mercedes</option>
        <option value ="audi">Audi</option>
        </optgroup>
    </select>
    <br>
    <input type="button" value="Delete Selected" onclick="doDelete(this.form);">
    </form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Thank you, thank you, thank you!!!
You are welcome. :-)

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

Though I am not very clear as to what you mean, this snippet should give you a fair idea. If it doesn't, post your code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Example</title>
</head>
<body>
<script type="text/javascript">
    (function doSomething() 
    {
        while(true) {
            var ans = prompt("Enter either 1 or 2.");
            if(!ans || (ans != '1' && ans != '2')) {
                alert("You entered an invalid choice. Exitting...");
                break;
            }
            alert("You entered " + ans);
        }
    })();
</script>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Don't read the file character by character. Always make sure your the I/O operations performed by your program are buffered unless needed otherwise. The less the I/O calls, the better. Instead, read the entire line in a string using BufferedReader / Scanner class and perform the processing. Of the many ways in which the solution can be achieved, regular expressions and manual looping are two of them.

Using the regular expression approach, the regular expression would look something along the lines of: 'Mr. Jones "dog" and "cat" bosh'.match(/[^"]*"([^"]+)"[^"]*"([^"]+)"[^"]*/); This is Javascript, but the concept doesn't change and if you are familiar with regexes you should be able to convert it into a Java equivalent without much effort. If you are not comfortable with regexes, manual looping is the way to go.

Using manual looping, all you would have to do is look for quotes, set a flag, start collecting characters until you find a matching quote, reset the flag and continue the process. The matched data can be stored in a container like ArrayList.

I would personally go with the looping approach due to it's simplicity and extensibility. Plus if this is a homework problem, I am sure your professor would be expecting the looping approach rather than a classy regular expression solution.

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

The content and links of this post are good enough to get you started.

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

> Or should i just create WEB-INF folder.

Simply put, your application will be treated as a web application only if it has a WEB-INF (case matters) directory in it's tree structure. From the Servlet Specification:

A special directory exists within the application hierarchy named “WEB-INF”.
This directory contains all things related to the application that aren’t in the
document root of the application. The WEB-INF node is not part of the public
document tree of the application. No file contained in the WEB-INF directory may
be served directly to a client by the container. However, the contents of the WEBINF
directory are visible to servlet code using the getResource and getResource-
AsStream method calls on the ServletContext, and may be exposed using the
RequestDispatcher calls. Hence, if the Application Developer needs access, from
servlet code, to application specific configuration information that he does not
wish to be exposed directly to theWeb client, he may place it under this directory.
Since requests are matched to resource mappings in a case-sensitive manner,
client requests for ‘/WEB-INF/foo’, ‘/WEb-iNf/foo’, for example, should not result
in contents of the Web application located under /WEB-INF being returned, nor
any form of directory listing thereof.

The contents of the WEB-INF directory are:
• The /WEB-INF/web.xml deployment descriptor.
• The /WEB-INF/classes/ directory for servlet and utility classes. The classes
in this directory must be available to the application class …

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

Changing a system which works for 99% of the people out there doesn't make any sense.

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

> i did uploading a file with using <input type=file> but is it possible to upload file without
> using<input type=file>
AFAIK, no.

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

> Am I doing something wrong or am i totally incompetent?
You are probably asking this question in the wrong forum. This question has no longer remained a Javascript one since you have been successfully able to send the JSON encoded string to the server.

The way you decode the string on the server is purely dependent on your server side language of choice. Try asking this question in the C# or VB .NET forums of Daniweb.

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

> If need to type the contained ArrayLists but those can contain any type you can use
> <ArrayList<ArrayList<?>>
That way he would neither be able to instantiate nor insert elements into the given list.

A better way would be to do something like:

public class Lists {
    public static void main(String args[]) {
        /* First approach */
        List<List<? extends Object>> lists = new ArrayList<List<? extends Object>>();
        List<Object> listOne = new ArrayList<Object>();
        listOne.add("hello"); listOne.add(666);
        lists.add(listOne);
        List<Integer> listTwo = new ArrayList<Integer>();
        listTwo.add(1); listTwo.add(2);
        lists.add(listTwo);
        List<String> listThree = new ArrayList<String>();
        listThree.add("listry"); listThree.add("kaboom");
        lists.add(listThree);
        System.out.println(Arrays.asList(lists));
        
        /* Second approach */
        List<Klass> kLists = new ArrayList<Klass>();
        Klass klassOne = new Klass();
        klassOne.addToCharList("hello").addToNumList(34);
        kLists.add(klassOne);
        Klass klassTwo = new Klass();
        klassTwo.addToCharList("hi").addToCharList("bye").addToNumList(666);
        kLists.add(klassTwo);
        System.out.println(Arrays.asList(kLists));
    }
}

class Klass {
    private List<Number> numList;
    private List<CharSequence> charList;
    
    public Klass() {
        numList = new ArrayList<Number>();
        charList = new ArrayList<CharSequence>();
    }
    
    public Klass addToNumList(Number num) {
        numList.add(num);
        return(this);
    }
    
    public Klass addToCharList(CharSequence ch) {
        charList.add(ch);
        return(this);
    }
    
    @Override
    public String toString() {
        StringBuilder buf = new StringBuilder(1024);
        for(int i = 0, max = numList.size(); i < max; ++i) {
            buf.append(numList.get(i) + " ");
        }
        for(int i = 0, max = charList.size(); i < max; ++i) {
            buf.append(charList.get(i) + " ");
        }
        return(buf.toString());
    }
}

I find the second approach to be much more manageable than the first one.

Ezzaral commented: Good catch. Thanks. +5
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> when I open my pages using ip (and not host name) thier javascript functions and events
> don't fire.
You mean http://xxx.xxx.xxx.xxx:8080/webapp/test.html over http://hostname:8080/webapp/test.html ?

> can any one help?
Use firefox to run your web app and look at the error console. (Tools -> Error Console)

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

> var codeofheight = "<?php echo $codeofheight; ?>";
When enclosed in script tags, this is JS, not PHP.

> the opossite of this code
Opposite in what sense?

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

Use any C# JSON binding library which converts from JSON objects to C# objects and vice versa. The bottom section of the JSON home page has a lot of bindings for the C# language. LitJSON is one of those libraries you can use.

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

An embedded database having a small memory footprint would be a much better option considering the host of features you get along with it. Stay away from XML and flat files for the sake of your own sanity.

>I'm confused abt SQl cause there are plenty of SQL database out threre but which SQL relates
>to H2
H2, like most relational databases out there, implements a larger part of the SQL standard. So unless you are doing something funny along the lines of stored procedures / functions, you should be just fine with standard SQL tutorials. This and this should be a good starting point.

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

Paste only the relevant and indented code. Sifting through 50+ lines of unindented code is more of a bother.

As far as your problem is concerned, I don't see any name attribute assigned to your form elements and the algorithm I posted uses element names.

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

> I'll have to wait until it happens again.
...which would be like, never?

> I test my pages before publishing.
Or so you think.

> And I know how to fix the rendering problem.
IE doesn't.

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

> no , receiver write arbic and reach to me arbic
You need to provide us more information. Which language is your chat application written in? Is it a web application or a desktop application? Have you coded it or is it a third party application?

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

Yes, using Firefox as your development browser along with some useful plugins like Web Development and Firebug, you can cut down a lot on your development time.

And it doesn't depend on the IDE, really. It's more about experience and observation. I pinned down the problem the moment I saw those weird quotes. And you should be aware and quite competent with the IDE. In the screenshot I am posting, compare the two statements, one which has the weird quotes and the one which has the right kind of quotes. Don't you see a highlighting difference?

And which Eclipse are you using by the way? For web development using Java, you should be using WTP instead of the normal version which is not HTML/CSS/JS aware.

PS: > Edit: SOS, you beat me by a minute
And that too with a well indented code. ;-)

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

> my PL told me that someone do hacking if they are able to see the URL

Then your PL doesn't know what he is talking about. You don't achieve security by *hiding* URL's but by having a robust security framework in place for your application. Java, of all the languages out there has excellent security support. A little bit of research should get your started in the right direction.

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

You have been given your answer.

A URI can't contain any spaces and some other special characters, and if they do, they need to be encoded. With the way you are currently doing things, when the country name with spaces is encountered, the URI becomes report.jsp?address=some address when it should have been report.jsp?address=some%20address .

Using scriptlets in your JSP file is a bad practice not to mention that accessing a database from the JSP file is disastrous.

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

> XMLHttpRequestObject = new ActiveXObject(“Microsoft.XMLHTTP”);

If this is how your code looks in your Text Editor / IDE, you need to change the special character ” to double quotes ("). Avoid copy / pasting the code from your ebook into the editor since it might introduce such special characters.

A sample working snippet:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Expires" content="0"> <!-- disable caching -->
    <title>Ajax Example</title>
    <script type="text/javascript" src="ajax.js"></script>
    <script type="text/javascript">
        function getXmlHttpRequest() {
        if (window.XMLHttpRequest) {
            return new XMLHttpRequest();
        }
        else if (window.ActiveXObject) {
            /*@cc_on @*/ 
            /*@if (@_jscript_version >= 5)
            try {
                return new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    return new ActiveXObject("Microsoft.XMLHTTP");
                } catch (E) {
                    return null;
                }
            } @end @*/ 
        }
        else {
            return null;
        }
    }
    function getData(datasource, target) {
        var xhr = getXmlHttpRequest();
        xhr.open("GET", datasource, true);
        xhr.onreadystatechange = function() {
            if(xhr.readyState == 4) {
                if(xhr.status == 200) {
                    document.getElementById(target).innerHTML = xhr.responseText;
                }
                else {
                    alert("Some problem occured);
                }
            }
        }
        xhr.send(null);
    }
    </script>
</head>
<body>
<form id="frm" name="frm" action="#">   
<div id="frmContainer">
    <div id="tgt"></div>
    <p></p>
    <input type="button" onclick="getData('data.txt', 'tgt');" value="Get Data">
</div>
</form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Then why do I get errors if I accidentally leave one out?
Paste a code which supports your claim.

> This is required for XHTML.
No, it isn't. If you want scripts in your XHTML markup, enclose them in a CDATA section.

<script type="text/javascript">
// <![CDATA[
/* your javascript code here */
// ]]>
</script>

> That's all I use for new pages now. Everyone should be doing this, to ensure future
> compatibility.
IE is known to have serious problems with rendering XHTML, plus it is excessively strict. HTML 4 Strict works just fine. So unless you want to cut off the IE crowd or feel the pain, stay away from XHTML.

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

> Firefox requires the semicolons after the statements. IE lets you cheat.
Bosh. Ecmascript doesn't require you to have semicolons at the end of statements. Automatic semicolon insertion takes place during the parsing phase. There are no browser exceptions to this rule.

> And you have not &-coded your < and > characters inside the script.
Bosh. If you do so, they would no longer be comparison operators.

> The browser thinks they are an HTML tag.
That depends on the DOCTYPE and is only true for XHTML documents.

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

And if you still want to know a bit more about this thing, this blog post is does a good job of doing that.

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

Use the wztooltip to ease your task. If you don't want to use an external library, study his code and you can easily implement your own minimalistic tooltip framework.

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

The problem is that you are trying to access the src property of the anchor ( <a> ) element instead of the image element. Move the mouseover and mouseout declarations from the <a> tag to the <img> tag and it should work out to be fine. But then again, it's not the best of methods, you have been warned.

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

Read the part about document.cookie on this page. You are missing some important bits and pieces in your cookie creation code. Also it would be interesting to note that the cookie property of the document is not of type string though it normally is treated like one. Taking care of this should most probably solve your issue.

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

IE, of all the browsers out there seems to allow element references to be accessed by their id. This is a short hand notation not supported by any of the browsers out there. You need to make sure there are no such naming conflicts if you don't want your code to break in IE.

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

Initially the ResultSet cursor is positioned before the first record. You compulsorily need to do a next() before any call to getXXX() so that the cursor is properly positioned. It's actually a good idea to read the documentation of the function you are using in case of any exception / strange behavior.

if(rs1.next()) {
    out.println("<select name=" + rs1.getString("degree")+ ">");
}
while(rs1.next()) {
    rs1.getString("degree") + "</option>");
}

But it's a bad practice to use scriptlets let alone accessing the database in a JSP file, as they make your code difficult to maintain, messy and buggy.

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

Maybe you need something like this:

InputStream in = zipFile.getInputStream();
OutputStream out = new FileOutputStream(new File("a.bin"));
byte buf[] = new byte[1024 * 8]; /* declare a 8kB buffer */
int len = -1;
while((len = in.read(buf)) != -1) {
    out.write(buf, 0, len);
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

++

+=100

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

> From what I've been able to see, listeners aren't supported thoroughly yet. Are they a
> good universal thing to use right now?
There are two ways of attaching a listener to an event handler of an HTML element.

One is to directly assign a function to that event handler which would then act as a listener. An example would be:

window.onload = function() {
    initEvents();
    initGlobals();
}

The disadvantage here is that you can't attach multiple event handlers to the listener in a clean and simple manner since assigning another listener would result in the previous one being erased.

Another way is to use the functions provided by the event object such as attachEvent[IE only] or addEventListener [Gecko based browsers]. So, in a sense you are right in saying that the listener function is not supported by non-Gecko browsers like IE. Here I would be presenting a simple wrapper which would attach events in a almost transparent manner and should work on almost all browsers out there.

/**
 * Attaches a event listener
 * @author sos
 * @param el {HTMLElement} The element to which you would attach this listener
 * @param ev {String} The event name (eg. click)
 * @param fn {Function} The event listener function
 */
function addEvent(el, ev, fn) {
    if(el.addEventListener) {
        el.addEventListener(ev, fn, false);
    }
    else {
        el.attachEvent('on' + ev, fn);
    }
}

And oh, BTW, you don't need Javascript to get the rollover effect. It can be done …

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

You should be able to achieve what you want by making small changes in your existing code. Paste your code as digital-ether mentioned so we can give some suggestions. Here is how I would personally do it:

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Test</title>
    <script type="text/javascript">
    function init() {
        initEvents();
    }

    function initEvents() {
        var radDiv = document.getElementById && document.getElementById("divRadio");
        var txtDiv = document.getElementById && document.getElementById("divText");
        if(!radDiv || !txtDiv) {
            return;
        }
        var radGroup = radDiv.getElementsByTagName("input");
        var txtGroup = txtDiv.getElementsByTagName("input");
        for(var i = 0, max = radGroup.length; i < max; ++i) {
            var r = radGroup[i];
            addEvent(r, "click", (function(r, i) {
                return(function() {
                    for(var j = 0, max = txtGroup.length; j < max; ++j) {
                        if(j == i) {
                            txtGroup[j].disabled = false;
                        }
                        else {
                            txtGroup[j].disabled = true;
                        }
                    }
                });
            })(r, i));
        }
    }

    function addEvent(el, ev, fn) {
        if(el.addEventListener) {
            el.addEventListener(ev, fn, false)
        }
        else {
            el.attachEvent('on' + ev, fn)
        }
    }
    window.onload = init;
    </script>
</head>
<body id="body">
    <form id="frm" name="frm" action="#">
        <div id="divText">
            <input name="txtOne" value="Text One" disabled="disabled" /><br />
            <input name="txtTwo" value="Text Two" disabled="disabled" /><br />
            <input name="txtThree" value="Text Three" disabled="disabled" /><br />
        </div>
        <br />
        <div id="divRadio">
            <input type="radio" name="rad" id="radOne" value="one" />
            <label for="radOne">One</label><br />
            <input type="radio" name="rad" id="radTwo" value="two" />
            <label for="radTwo">Two</label><br />
            <input type="radio" name="rad" id="radThree" value="three" />
            <label for="radThree">Three</label><br />
        </div>
    </form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> where James Braddock forces his son to return stolen food despite the fact that the family
> was poor, freezing and starving
Yeah, that kind of thing looks really good in the movies and *only* in the movies.

> and they makes the ones who can throw away their morals when life gets hard look
> ridiculous.
I am sure those innocent kids would rather prefer to look *ridiculous* than die of hunger...

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

Yes, there are many libraries out there which do this but many people are against using libraries which result in a visible bloat. Implementing our own serialize function or by using the functions from one of the existing libraries in a separate JS file would be much more feasible.

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

> returnValue= true; This sets the value of the global variable returnValue to true and has got nothing to do with your issue.

> e.returnValue = true; This sets the return value of the event to ' true ' and is a MS only property. So your onclick returns false if the validation fails and thereby prevents form submission.

> e.preventDefault() This cancels / prevents the default action caused by the event. In our case, the click action submits the form which is prevented by calling p reventDefault(). It is important to notice that both e.returnValue = false; and e.preventDefault() in our case achieve the same purpose(of cancelling the forum submission) for different browser types.

OmniX commented: Very helpful information =) +1
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

What do you mean by *lauch* an IFRAME? Surely you must be meaning to say you *load* a HTML page in the existing IFRAME? If so, the code which does this might help us in knowing why your web page is not loaded in the IFRAME in IE.

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

> Am I supposed to care? If there's no penalty, why not?
Don't pirate to pirate, just pirate.

If you feel like owning MS Windows without paying for it, do it, but don't expect to seek justifications for your action. If you feel like being part of the *good* and using only those things which you have paid for, follow it. In the end, it boils down to your thoughts and actions. Eventually both good and evil are relative. What might be evil / bad for someone else might seem justified to you. Be prepared to accept what you deserve. What goes around comes around, really.

> Are you advocating that all software should be open source?
Give a stripper her pole and see the way she moves.

>You seem to be incorrectly assuming that you can't make money off open source software.
You seem to be incorrectly assuming that you can earn a living only off open source software.

> Pirates should be at the very least locked up for a very long time, denied access to the
> means of their trade for life, and made to repay the damages they caused even if it
> means they're bankrupt until their death (labour camps could be set up for this).
Planning to resurrect Hitler?

"Play around with words and become a hero on paper; try that in practice and get beaten blue ad black to reality."

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

> An alternative approach to using a return statement is to set the "event.returnValue" to false:
...which would only work in IE.

In IE the event generated becomes a event property of the window object whereas in Gecko based browsers it is passed as a first argument to the event listener. A better approach would be:

function handle(e) {
	var e = e || window.event;
	if(!confirm("Do you want to continue?")) {
		if(e.preventDefault) {
			e.preventDefault();
		}
		else {
			e.returnValue = false;
		}
	}
}

<!-- more code -->

<input type="submit" onclick="handle(event);" />
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Also don't forget to encode the query string to handle special characters or characters which already have a predetermined meaning in the querystring. (eg. &)

It would be better if you used a form serializing function which would serialize the entire form and return the resulting query string.