Solved

Different forms posting the same database

Posted on 2004-07-30
3
199 Views
Last Modified: 2013-12-24
I register players for events.  I would like the participant to select an event and location on a separate page from the form itself iand have the form field "event" and "location" on the actual form filled in.  There is too many events and/or locations to use a drop down box on the actual form.  If I must create as many forms as events that would be cumbersome but ok.   Or if I could have method that when the participants came to the event field (or location field) they could open another page to make their selection and it would paste or fill out that field on the form...   I guess I would like a more elegant drop down box.  This would be an ASP form.  Don't know if there is a problem with multiple forms posting the same database?
0
Comment
Question by:bnp6622
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
rcmb earned 500 total points
ID: 11676100
On the first page create the form with your drop-downs for event  and location.

Have the form post to your other form page and in the second form (your actual form) in the box for event enter

<input name="event" type="text" value="<%=request.form("event")%>">

and for the location enter

<input name="location" type="text" value="<%=request.form("location")%>">

in the values section of each box

You can also use hidden fields so the user is not tempted to modify the displayed boxes like so:

<input name="event" type="hidden" value="<%=request.form("event")%>">
<input name="location" type="hidden" value="<%=request.form("location")%>">

or use a drop-down with the only one option

<select size="1" name="event">
        <option><%=request.form("event")%></option>
        </select>

<select size="1" name="location">
        <option><%=request.form("location")%></option>
        </select>

RCMB
0
 
LVL 3

Expert Comment

by:hawks4ever
ID: 11676696
Try this.  This basic script will get your event.  Minimal changes will get the location in the same way for you.

<script language="JavaScript">
function doLookup() {
      window.open("lookup.asp?formName=form1&formField=strEvent","","width=500 height=250, scrollbars=yes")
}
</script>

<form method="post" action="result.asp" name="form1">
<input type="text" name="strEvent" size="25"> <a href="javascript:doLookup()">Look for it</a>
</form>

----------------lookup.asp code-------------------
<form name="form2">
  <p><input type="radio" name="strEvent" value="Event 1">Event1</p>
  <p><input type="radio" name="strEvent" value="Event2">Event2</p>
  <p><input type="button" value="Select" name="go" onclick="javascript:opener.document.<% =Request("formName") %>.<% =Request("formField") %>.value = ' + form1.strEvent.value + '; setTimeout('self.close()', 500);"></p>
</form>
0
 
LVL 12

Expert Comment

by:rcmb
ID: 11747400
bnp6622,

If you desire to chat with me about additional help you can reach me at rcmb25@bellsouth.net

RCMB
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question