473,385 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1969
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*****@discussions.microsoft.com> wrote in message
news:02**********************************@microsof t.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*****@discussions.microsoft.com> wrote in message
news:02**********************************@microsof t.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.jscript 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*****@discussions.microsoft.com> wrote in message
news:02**********************************@microsof t.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
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) ...
19
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...
4
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...
5
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...
8
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...
16
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....
11
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...
12
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...
6
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.