navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Multiple Submits for a Single Form

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Multiple Submits for a Single Form
Page: [1]
 
Guest


 
Multiple Submits for a Single Form - 3/14/2001 20:31:00   
Anyone have an idea how to create a form in which a data from a single text box can be submitted to different queries (asp pages) using multiple submit buttons with different labels. I know I can do this by simply setting up several forms, but it's an inconvienence to the customer to have to type the same info into different fields....and it looks bad.

Thanks..

Vince from Spain

 

Posts: 658
From: Madrid Spain
Status: offline

 
RE: Multiple Submits for a Single Form - 3/14/2001 20:28:00   
Hi Shmoop,
the first thing here is that what I would probably do in this circumstance is have ONE results page, but have different actions depending on the button pressed. The reason is that if you have the option of doing something client side or server side, normally best to choose server side.

So in the calling page you have
<input type="submit" name="mybutton" value="first">
<input type="submit" name="mybutton" value="second">

etc, and then in the results page
<% if request.form("mybutton") = "first" then %>
. . . all the html / asp to do with that one
<% elseif request.form("mybutton") = "second" then %>
. . . and all the html / asp to do with the second one
<% end if %>

But, if that is not a possibility then you can do what you want with a bit of javascript. For instance . . .

<HTML>
<HEAD>
<script language=javascript>
function gotopage(act) {
document.myform.action = act;
document.myform.submit();
}
</script>
</HEAD>
<BODY>
<form method="post" name="myform" action="doesntmatter.htm">
<A href="javascript:gotopage('page1.htm')"><IMG name="imgname" border="0" src="imgname.gif" ></a>
<input type="submit" name="button" value="hghgh" onclick="gotopage('page2.htm')">
</form>
</BODY>
</HTML>

I've put in one image button and one submit button to illustrate how to do it with either.

All the best

Vince

------------------
Internet Business Solutions S.L.(Spain)


(in reply to Guest)
Guest


 
RE: Multiple Submits for a Single Form - 3/14/2001 23:57:00   
Many thanks Vince,
The first method looks very nice as I can have only one results page for the plethora of queries that are normally generated in multiple asp pages. Of course, that is also an issue as I would need to take a bit of time to compile them all....so I opted for the second method which works perfectly and was easier to insert in all my pages. Time permitting, I want to try the other too!

Second question along the same lines....open to anyone...

One of my queries produces only one record...and I want to link the data from one of the fields in that record to a second query. One method is to use a hyperlink in the results of the first query....and I've used this method before. But because, it's only one record, I looks better if I just have a "Submit" button under the form results that when clicked, initiates the second query.

I tried:

<form method="POST" action="somequery.asp" >
<p><input type="Submit" value="MoreInfo" name="B1"></p>
<input type="hidden" name="Value name sent to second query" value="<%=FP_FieldVal("Value")%>">
</form>

Doesn't work....VBScript error....any ideas?


(in reply to Guest)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Multiple Submits for a Single Form - 3/14/2001 15:14:00   
Looks OK, is it within the region of the DRW code?

If it isnt (like so)

DRW start
fp_rs results
DRW End

Your form....

Then there is no way the asp cose will know what you mean by FP_FieldVal("Value")

This is a result that must be returned from with in the DRW boundaries

------------------
Spooky
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!


(in reply to Guest)
Guest


 
RE: Multiple Submits for a Single Form - 3/14/2001 15:40:00   
Getting closer, I think.....

The only html on the asp page is the DRW followed by the form....so I think the form is within the DRW region.

At first I tried:
value="<%=FP_FieldVal(fp_rs,"Value")%>"
but it returned an error on "type mismatch 'rs'"

I tried removing the "fp_rs" to get:
value="<%=FP_FieldVal("Value")%>"
but returned an "Wrong number of arguments or invalid property assignment: 'FP_FieldVal'"

For kicks I tried removing just the "rs" to get:
value="<%=FP_FieldVal(fp_,"Value")%>"
but get an "Object missing"

I'm missing something somewhere....
I know this is getting a little over worked for a simple task, and I'm about ready to just put clickable image hyperlink to do the trick...but now I'm stubborn and want to know how to fix it!!


(in reply to Guest)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Multiple Submits for a Single Form
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts