473,698 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form with diferrent action forms depending on the context

Hi all,
I have a form with 3 combobox whitin a asp page called data.asp, whose
action form is itself; the first combobox drives the behaviour of the other
two.
The onchange event of the first combobox is related to a javascript function
in which I call the submit method for the form, whose action form is itself.
This works fine.
The problem is that if I want to save the changes done by the user (clicking
the OK button) I need to set the action of the form to another page, for
example save.asp.
The question is: how to do this?
I had written a function inside the onclick method of the OK button that is
similar to the following one

document.MyForm .action = "save.asp";
document.MyForm .submit();

But it doesn't work properly, because the page save.asp is never invoked.

Thanks in advance for the help,
Michele.

Jul 22 '05 #1
3 1979
This is mostly a clientside issue, not asp but what kind of button is it?
Type=Button or Type=Submit?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Michele" <Mi*****@discus sions.microsoft .com> wrote in message
news:02******** *************** ***********@mic rosoft.com...
Hi all,
I have a form with 3 combobox whitin a asp page called data.asp, whose
action form is itself; the first combobox drives the behaviour of the
other
two.
The onchange event of the first combobox is related to a javascript
function
in which I call the submit method for the form, whose action form is
itself.
This works fine.
The problem is that if I want to save the changes done by the user
(clicking
the OK button) I need to set the action of the form to another page, for
example save.asp.
The question is: how to do this?
I had written a function inside the onclick method of the OK button that
is
similar to the following one

document.MyForm .action = "save.asp";
document.MyForm .submit();

But it doesn't work properly, because the page save.asp is never invoked.

Thanks in advance for the help,
Michele.

Jul 22 '05 #2
It's a Submit button.
Type = Submit

"Curt_C [MVP]" wrote:
This is mostly a clientside issue, not asp but what kind of button is it?
Type=Button or Type=Submit?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Michele" <Mi*****@discus sions.microsoft .com> wrote in message
news:02******** *************** ***********@mic rosoft.com...
Hi all,
I have a form with 3 combobox whitin a asp page called data.asp, whose
action form is itself; the first combobox drives the behaviour of the
other
two.
The onchange event of the first combobox is related to a javascript
function
in which I call the submit method for the form, whose action form is
itself.
This works fine.
The problem is that if I want to save the changes done by the user
(clicking
the OK button) I need to set the action of the form to another page, for
example save.asp.
The question is: how to do this?
I had written a function inside the onclick method of the OK button that
is
similar to the following one

document.MyForm .action = "save.asp";
document.MyForm .submit();

But it doesn't work properly, because the page save.asp is never invoked.

Thanks in advance for the help,
Michele.


Jul 22 '05 #3
Change it to "Button" if you want to use its onclick event to submit the
form.

Please followup in a client-side script group if you ahve further questions
about this. .scripting.jscr ipt will get you prompt answers.

Bob Barrows
Michele wrote:
It's a Submit button.
Type = Submit

"Curt_C [MVP]" wrote:
This is mostly a clientside issue, not asp but what kind of button
is it? Type=Button or Type=Submit?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Michele" <Mi*****@discus sions.microsoft .com> wrote in message
news:02******** *************** ***********@mic rosoft.com...
Hi all,
I have a form with 3 combobox whitin a asp page called data.asp,
whose action form is itself; the first combobox drives the
behaviour of the other
two.
The onchange event of the first combobox is related to a javascript
function
in which I call the submit method for the form, whose action form is
itself.
This works fine.
The problem is that if I want to save the changes done by the user
(clicking
the OK button) I need to set the action of the form to another
page, for example save.asp.
The question is: how to do this?
I had written a function inside the onclick method of the OK button
that is
similar to the following one

document.MyForm .action = "save.asp";
document.MyForm .submit();

But it doesn't work properly, because the page save.asp is never
invoked.

Thanks in advance for the help,
Michele.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #4

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

Similar topics

9
2013
by: Tom | last post by:
I have created the following code for a product select/payment form (don't know if there is a better way) and I have been trying to make the following changes (unsuccessfully so far): 1) Eliminate the submit button and submit the form with onchange. 2) Open the action php page in a new window. I am using this code for different payment options (i.e., cc processing and paypal). As such, there are multiple forms on the page. The...
19
2988
by: Pete | last post by:
I have form/select which executes a function using onchange. No problem. However, when I validate the page with a strict HTML 4.01 doctype at http://validator.w3.org, it demands either an action or a method for the form?. If I give it an empty action <form action="" ..... it validates OK. Is this acceptable or is there a better/standards correct way? Thanks.
4
7421
by: mappo | last post by:
There are about a million posts on how to get rid of the extra space _after_ the form end-tag, but I can't find any that solve my problem: extra space _in_ the form tag. I have a table nestled inside the form and since I want the submit button underneath the input text field i have a br tag to separate them. For some reason IE5.5 gives me what seems like two br tags. It looks good in Opera 7, and in K-Meleon 0.6 (Gecko).
5
6085
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the Internet. Specifically, marking up a document that will contain multiple related form controls (intended exclusively for client-side scripting) that would never be intended to be submitted. I realise that that concept is a non-starter in an Internet...
8
1720
by: TNGgroup | last post by:
Hi, Question, I have a simple form and want to submit a selected value of a combo box. so my combo box is named "selectname" and my form has action="file.asp?" what do I have to put after the question mark ? Thx in advance Wim
16
11861
by: David Lauberts | last post by:
Hi Wonder if someone has some words of wisdom. I have a access 2002 form that contains 2 graph objects that overlay each other and would like to export them as a JPEG to use in a presentation. I can do this individually for each graph but this does not help me as I need both on the same JPEG. I thought I would try an export the form that contains both but I am having trouble. (My VBA is self taught and a little knowledge is...
11
18832
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that they are too big and wind up covering up some of the fields on the main form. Is there any good code out there that works in a similar fashion that will also either a) stretch the form width wise on widescreens or b), rely on height rather than...
12
3437
by: TheOne | last post by:
In Asp.net web form under form tag there is action field that I am point to some other page, and not to same web form. When I run this page it is always pointing to itself. How do I get around this? Here is HTML code from webform.. Thanks, Sinisa
6
2878
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the data table. The lookup
0
8668
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
8598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8855
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
7708
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
6515
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
5857
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
4612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3037
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
2
2320
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.