473,602 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can a form have two POST locations? Workarounds?

Is it possible to POST a FORM to multiple URLS at the same time....OR....

Is the only workaround for this scenario to use response.redire ct in the
called ASP page and do a multi processing?

- Jason
Jul 19 '05 #1
2 4792
While you can use client side code to change the action of your form, I
personally stay away from relying on client side code for such things.
What I would do instead is:

<form method="post" action="page.as p">
<form stuff here>
<input type="submit" name="cmdSubmit " value="Delete Users">
<input type="submit" name="cmdSubmit " value="Disable Users">

Then, in page.asp:

sSubmit = UCase(Request.F orm("cmdSubmit" ))
Select Case sSubmit
Case "DELETE USERS"
''the code that you currently have in pagea.asp
Case "DISABLE USERS"
''the code that you currently have in pageb.asp
Case Else
''if you'd like a default action that will hopefully
''need to fall back on - see below
End Select
The problem with this method though is that if you have a designer who
doesn't like the values of your submit buttons and changes them, you
will have to be aware of this and update your code accordingly. So, the
other method, which will rely on the name of the submit button instead
of the value would be:

<form method="post" action="page.as p">
<form stuff here>
<input type="submit" name="cmdDelete " value="Delete Users">
<input type="submit" name="cmdDisabl e" value="Disable Users">

Then in page.asp:

If Request.Form("c mdDelete") <> "" Then
''the code that you currently have in pagea.asp
End If ''or else if you prefer

If Request.Form("c mdDisable") Then
''the code that you currently have in pageb.asp
End If

This, again though, if your designer renames the submit buttons, you'll
have to be aware of this, or have a default action to fall back on.

And now the other thing, if you've read this far, is that if your user
presses enter to submit the form (or Ctrl+M), neither of these values
will be present, so you will have to have either have a default option,
which could either run your code, or redirect back with an error that
says "Please click on the action you'd like to take." or something along
those lines.

When I use two submit buttons, I'll normally use instr instead of a full
comparison anyway, like:

sSubmit = UCase(Request.F orm("cmdSubmit" ))

Select Case True
Case Instr(sSubmit, "DELETE") > 0
'code
Case Instr(sSubmit, "UPDATE") > 0
'code
Case Else
'default
End Select

Or, you could not do the ucase and do a text comparison:
Instr(sSubmit, "delete", 1), then it wouldn't matter if it's DeLeTE,
delete, DELETE, or anything else.
Ray at work

"jason" <ja***@catamara nco.com> wrote in message
news:el******** ******@TK2MSFTN GP09.phx.gbl...
Is it possible to POST a FORM to multiple URLS at the same time....OR....

Is the only workaround for this scenario to use response.redire ct in the
called ASP page and do a multi processing?

- Jason

Jul 19 '05 #2
Many thank Ray!

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:eA******** ******@TK2MSFTN GP09.phx.gbl...
While you can use client side code to change the action of your form, I
personally stay away from relying on client side code for such things.
What I would do instead is:

<form method="post" action="page.as p">
<form stuff here>
<input type="submit" name="cmdSubmit " value="Delete Users">
<input type="submit" name="cmdSubmit " value="Disable Users">

Then, in page.asp:

sSubmit = UCase(Request.F orm("cmdSubmit" ))
Select Case sSubmit
Case "DELETE USERS"
''the code that you currently have in pagea.asp
Case "DISABLE USERS"
''the code that you currently have in pageb.asp
Case Else
''if you'd like a default action that will hopefully
''need to fall back on - see below
End Select
The problem with this method though is that if you have a designer who
doesn't like the values of your submit buttons and changes them, you
will have to be aware of this and update your code accordingly. So, the
other method, which will rely on the name of the submit button instead
of the value would be:

<form method="post" action="page.as p">
<form stuff here>
<input type="submit" name="cmdDelete " value="Delete Users">
<input type="submit" name="cmdDisabl e" value="Disable Users">

Then in page.asp:

If Request.Form("c mdDelete") <> "" Then
''the code that you currently have in pagea.asp
End If ''or else if you prefer

If Request.Form("c mdDisable") Then
''the code that you currently have in pageb.asp
End If

This, again though, if your designer renames the submit buttons, you'll
have to be aware of this, or have a default action to fall back on.

And now the other thing, if you've read this far, is that if your user
presses enter to submit the form (or Ctrl+M), neither of these values
will be present, so you will have to have either have a default option,
which could either run your code, or redirect back with an error that
says "Please click on the action you'd like to take." or something along
those lines.

When I use two submit buttons, I'll normally use instr instead of a full
comparison anyway, like:

sSubmit = UCase(Request.F orm("cmdSubmit" ))

Select Case True
Case Instr(sSubmit, "DELETE") > 0
'code
Case Instr(sSubmit, "UPDATE") > 0
'code
Case Else
'default
End Select

Or, you could not do the ucase and do a text comparison:
Instr(sSubmit, "delete", 1), then it wouldn't matter if it's DeLeTE,
delete, DELETE, or anything else.
Ray at work

"jason" <ja***@catamara nco.com> wrote in message
news:el******** ******@TK2MSFTN GP09.phx.gbl...
Is it possible to POST a FORM to multiple URLS at the same time....OR....
Is the only workaround for this scenario to use response.redire ct in the
called ASP page and do a multi processing?

- Jason


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
4082
by: Sheela | last post by:
hi all, I'm searching all around the web without any good answer, maybe you have the right one. I'm trying to fill&send a form on a site authenticated https via curl. The problem is simply that it doesn't arrives to authenticate.. It returns id error1 -> unsupported protocol. The code is the following:
2
5803
by: Matt | last post by:
I want to post the form data (http://server/page1.asp) to a modal dialog window (http://server/modaldialog.asp) with a desired height 200px by width 200px. Here's my attempts and problems: Attempt #1) In http://server/page1.asp, it has code <form action="http://server/modaldialog.asp" method="post" target="_blank"> In http://server/modaldialog.asp, it has code <body onBlur = "self.focus()">
2
6511
by: Matt | last post by:
I reposted this question because I really want to accomplish this task. Please advise!! I want to post the form data (http://server/page1.asp) to a modal dialog window (http://server/modaldialog.asp) with a desired height 200px by width 200px. Here's my attempts and problems:
1
6590
by: Matt | last post by:
The following program submit a FORM DATA to a new window using HTTP POST, and postprocess.asp couldn't get the form data. If I do in GET method and pass by query string in windowURL, then it works. But I need HTTP POST method, are there any workarounds? <html> <script type="text/javascript"> function checkAndSubmitForm(theForm)
1
3770
by: Display Name | last post by:
the customer I'm developing a site for uses a canned form-parsing page that allows her to have an email subscription opt-in page add emails to a list she can manage using a link that you point your HTML form to. the actual form-parsing page resides on a server that's uneditable to me since it sits on an inaccessible server. my problem is more irritating than anything; everything double-submits.. when you submit the form, I've forced a...
6
2820
by: Amir Hardon | last post by:
I'm new to DOM and can't figure out this thing: I'm trying to add a row to a table with a form field in one of it's cells, but if I'm appending the field to a form it gets out of the table. Can some one tell me what I'm doing wrong? it looks like this: var tbl=document.tbl; var frm=document.frm; var newcell=document.createElement("TD");
2
3624
by: Clayton Hamilton | last post by:
I have a DataGrid on a webform bound to a Datasource and can successfully use <ItemTemplate> to create edit/update/cancel functionality for user maintenance of data. I use separate logic to delete a row. Everything works just fine. BUT I would like to add a button to (for example) the DataGrid header, which when pressed will add a new row to the datagrid. This should then allow the user to enter information into text boxes (in some...
1
2326
by: sam | last post by:
Hi All, I have a form with 4 checkboxes and 4 text boxes and one submit button. The form should work such a way when I select a particular checkbox and give a url in text box, the form should get submitted to that url entered in the text box. Is this possible. I know to submit form by metioning the action attribute only. How do this with one button but submitting to different locations on different selection...Can any one help me...
13
8898
by: geosmy | last post by:
Hi everyone, First post here! I have been trying to upgrade to Acc2007 looking forward to using Split Forms. To my horror I have just discovered that Split Forms do not hold variables at module level!!! Although code is working perfectly well when in Single Form view, when switching to Split Form view... problems. This must definitely be a bug unless there are limitations to Split Forms (doubt it). Although there might be some...
0
7993
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8405
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8056
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8270
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3901
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.