magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2000 > 06 > Help Desk  

Help Desk

By Jerry Lee and Kenny Shi, Guest Editors

Forms with Function

Dear Help Desk,
I am using FrontPage 2000 to create a Web site where a user can input data into a form that will be stored in the database. I want to allow the user to upload a small JPEG file at the same time. The code would also store a unique name for the JPEG in the Access database along with other data on the form. That way, when other users retrieve records they'll get reports with the correct pictures attached. I can get FrontPage to load form-based data and I can use SA-FileUp to upload the JPEG on a separate form, but I cannot get them working together. Do you know a way to do this?
- Daniel

Dear Daniel,
The workaround is to create two separate forms (for example, Data and Upload) on the same HTML page that take data and files separately. Write a JavaScript function so that when the user fills out the form and uploads the file, it grabs the Data form's elements and places them into hidden form elements in the Upload form. Then have SA-FileUp handle the upload, and repost the form to itself. The form page gets the repost data and populates it into form components. The structure looks like this:

<HTML> <body> ....
<%if [From File-Upload repost] Then
 populate the fields
 user_id = Request("user_id")
        ...
end if%>
<form name="Data" 
 action="FormHandler.asp" 
 method="Post">
 <input type=text name="user_id" 
 value="<%=user_id%>">
        ...
</form>

<form name="Upload" action="SA-FileUp" method="Post" onSubmit="populateForms()"> <input Type=File ..




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2