Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 15th, 2003, 05:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Here's the html page I used to test it out, take a look at the js function at the top of the page. It just needs a bit of tightening-up to check that the field objects exist before trying to access the value properties.

Code:
<html>
<head>
<SCRIPT LANGUAGE="javascript" type="text/javascript">
<!--
function submitData(frm)
{
    if (frm)
    {
        var sAction = "PostFileAndData.asp?";
        sAction += "text1=" + escape(frm.text1.value);
        sAction += "&text2=" + escape(frm.text2.value);
        frm.action = sAction;
        frm.submit();
    }
}
//-->
</SCRIPT>

<title>Upload File and data Test</title>
</head>
<body>
<FORM action="PostFileAndData.asp" method=POST id=form1 name=form1 enctype="multipart/form-data">
<INPUT type="file" id="file1" name="file1">
<INPUT type="text" id="text1" name="text1">
<INPUT type="text" id="text2" name="text2">
<INPUT type="button" value="Button" id="button1" name="button1" onclick="submitData(this.form);">
</FORM>
</body>
</html>
hth
Phil






Similar Threads
Thread Thread Starter Forum Replies Last Post
VB 2005 question, binary to text file conversion pitcher General .NET 0 September 24th, 2007 07:45 PM
Binary Search on a text file scoobie Pro Java 1 August 25th, 2006 12:43 AM
Opening Text file in Binary mode for reading lawsoncobol Access VBA 1 August 3rd, 2006 04:01 AM
leaving blank text box in form when inserting data saif44 ASP.NET 2.0 Professional 1 March 9th, 2006 07:29 AM
Reading from a text file and writing to a Binary 1 scott01 C++ Programming 0 July 28th, 2003 03:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.