Q:

New HTML page after form validation

I want to show the results of the data gathered by the input. Here's what I've done, but it's not working after I finish filling the fields and after the function returns true.
    <form name ="reg" action ="" onsubmit ="return checkValidation(this)">//CODE...

Here's the called function:
function checkValidation()
    {
    var valid = isValidName();
        if(valid)
        valid = isValidEmail();
        if(valid)
        valid = isValidPass();
        if(valid)
        valid = isValidRadio();
        if(valid)
        {
        document.write(document.reg.name.value);
        }
        return valid;
    }

Whats the problem? how can I open a new page with this data?
Thank you!

A:

Use this on your called function:
function checkValidation()
{
var valid = isValidName();
    if(valid)
    valid = isValidEmail();
    if(valid)
    valid = isValidPass();
    if(valid)
    valid = isValidRadio();
    if(valid)
    {
    document.write(document.reg.name.value);
    return false;
    }
    return valid;
}

what you are actually doing with the return false; is cancelling the submit event, because the onSubmit() event requires to return true in order to continue with the actual submit to the page defined in action="" (in your case none, which results in a white page).
Also take in consideration that you have already processed the frontend variables (or show them) by the time that you return false (these procedures happen in your browser). If you want the actual data to be sent to a server (and be on the same page without reload), you should probably use an ajax call to your server side script.

