DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Jay Swan Guest

    Validate Input type=file box on form submission


    New JavaScript'er here...
    Any ideas on why this always to the return true case...
    TIA : Jay

    <%@ Language=VBScript %>
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    </HEAD>
    <BODY>

    <IMG SRC="file://C:\temp\TopFrame.gif">

    <SCRIPT language="JavaScript">
    <!--
    function VerifyData()
    {
    if (document.frmUser.subOMContent.Value != "" )
    {
    alert ("Has Selected File - Value True");
    return true;
    }
    else
    alert ("Please Select A File To Contribute To Content Management...");
    return false;

    }
    -->
    </script>

    <form action="PushContent.htm" Method=post Name=frmUser onSubmit="return
    VerifyData()">
    <Table Align="Center" Border=3>
    <tr>
    <td Align="Center">
    <strong>
    Select File For Content Management
    </strong>
    </td>
    </tr>
    <tr>
    <td> <input size=100 type=file name=subOMContent></td>
    </tr>
    <tr>
    <td Align="Center"><INPUT type="submit" value="Submit Content" id=submit1></td>
    </tr>

    </Table>
    </form>
    </BODY>
    </HTML>

    Thanks, again.
    Jay.Swan.b@Bayer.com


  2. #2
    MarkN Guest

    Re: Validate Input type=file box on form submission


    Ask this in the Javascript Discussion. This is a Java discussion.


    Mark

    "Jay Swan" <Jay.Swan.b@bayer.com> wrote:
    >
    >New JavaScript'er here...
    >Any ideas on why this always to the return true case...
    >TIA : Jay
    >
    ><%@ Language=VBScript %>
    ><HTML>
    ><HEAD>
    ><META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    ></HEAD>
    ><BODY>
    >
    ><IMG SRC="file://C:\temp\TopFrame.gif">
    >
    ><SCRIPT language="JavaScript">
    ><!--
    > function VerifyData()
    > {
    > if (document.frmUser.subOMContent.Value != "" )
    > {
    > alert ("Has Selected File - Value True");
    > return true;
    > }
    > else
    > alert ("Please Select A File To Contribute To Content Management...");
    > return false;
    >
    > }
    >-->
    ></script>
    >
    ><form action="PushContent.htm" Method=post Name=frmUser onSubmit="return
    >VerifyData()">
    ><Table Align="Center" Border=3>
    > <tr>
    > <td Align="Center">
    > <strong>
    > Select File For Content Management
    > </strong>
    > </td>
    > </tr>
    > <tr>
    > <td> <input size=100 type=file name=subOMContent></td>
    > </tr>
    > <tr>
    > <td Align="Center"><INPUT type="submit" value="Submit Content" id=submit1></td>
    > </tr>
    >
    ></Table>
    ></form>
    ></BODY>
    ></HTML>
    >
    >Thanks, again.
    >Jay.Swan.b@Bayer.com
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links