473,387 Members | 2,436 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,387 software developers and data experts.

form attribute action and input with same name

Hello

I want to change attribute action in form. Problem is that in that form
is also input with name action. Unfortunately renaming of that input is
worst case because many servlets depend on it.

This works in konqueror but not in IE and Mozilla:

newurl= document.forms[i].getAttribute('action');
newurl= newurl.replace('all/', prefix);
document.forms[i].action= newurl;

Do you have any idea how to modify attribute action in this case ?
Jan
Jul 23 '05 #1
5 4721
"Jan Gregor" <gr********@NOSPAMquick.cz> wrote in message
news:cj***********@ns.felk.cvut.cz...
Hello

I want to change attribute action in form. Problem is that in that form
is also input with name action. Unfortunately renaming of that input is
worst case because many servlets depend on it.

This works in konqueror but not in IE and Mozilla:

newurl= document.forms[i].getAttribute('action');
newurl= newurl.replace('all/', prefix);
document.forms[i].action= newurl;

Do you have any idea how to modify attribute action in this case ?
Jan

What does your form look like?

Is it basically like the following?

<form action="nextpage.htm" method="post">
<input type="text" name="action">
</form>

And is your problem that you want to change "nextpage.htm" to something
else?
Jul 23 '05 #2
On 2004-09-24, McKirahan <Ne**@McKirahan.com> wrote:

What does your form look like?

Is it basically like the following?

<form action="nextpage.htm" method="post">
<input type="text" name="action">
</form>

And is your problem that you want to change "nextpage.htm" to something
else?


Yes.

There's an example:

<form action="all/OrderCostKeyList" method="get" name="frmOCKL">
<input type="Hidden" name="action" value="step2">

I want to transform all/OrderCostKeyList to client/OrderCostKeyList.
There's little progress. In getAttribute replace of 'action' to 'Action' lead
to success in mozilla(firefox). Of course I see that this is a bit
magic. On other side browsers should allow access to attributes other
way or inputs with same name as attributes should be banned.

Jan
Jul 23 '05 #3
On Fri, 24 Sep 2004 11:46:44 +0000 (UTC), Jan Gregor
<gr********@NOSPAMquick.cz> wrote:
I want to change attribute action in form. Problem is that in that form
is also input with name action.
[snip]
Do you have any idea how to modify attribute action in this case ?


I don't think there is any way. Certainly not one that would be reliable.
Either rename the control, or perhaps have all/OrderCostKeyList redirect
to client/OrderCostKeyList server-side.

You should always try to ensure that form controls do not conflict with
member names. Due to the provision of shortcut control accessors -
expressions like

document.formName.controlName

- a form control with override the value of an existing property. Names
like submit, reset, action, and method (this is not an exhaustive list)
should be avoided.

Good luck,
Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #4
VK
var act = myForm.getAttributeNode('action');
act.value = newURL;
Approved in DOM 1, tested OK under my IE 6.0
P.S. My Lord, I didn't realize what a mess they did since 4th versions...
Good to know...
form.action= (property) and form.action.value= (form element) should have
and used to have totally different assignments.
This is that you get by "simplifying" a normal language into an Orwell style
"newtalk".

Jul 23 '05 #5
In article <41***********************@news.freenet.de>, VK wrote:
var act = myForm.getAttributeNode('action');
act.value = newURL;
Approved in DOM 1, tested OK under my IE 6.0


It works under konqueror and firefox, but not in IE5. Opera6 doesn't
support changing of action at all.
Jan
Jul 23 '05 #6

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

Similar topics

5
by: Bruce Duncan | last post by:
I can't seem to figure our why this doesn't work. I don't get any errors, it just doesn't submit. Can anyone shed some light. <?PHP $var1 = "http://localhost/php/index.php"; $varx = "bruce";...
13
by: dogu | last post by:
Noob alert. Code is below. File is saved as a .php. What I'm trying to do: User uses 'select' box drop down list to pick a value. Value ($site) is derived from a db query. This works fine....
4
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM:...
10
by: iam247 | last post by:
Hi In my prototype asp page (with no javascript and no password validation, I have a registration form with the following action: <form name="form" method="post" action="RegDetails.asp"> ...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
6
by: drec | last post by:
I am just learning Javascript and I would like to create a basic form that gives me two options. This will be using either checkbox or radio input type, however I would like the second option to...
13
by: johnemmatty | last post by:
I am using an asp page in which i dynamically fill the ACTION property of the form. The problem is that whenever i try to redirect to a html page using the javascript:location, it is getting...
1
by: Denis | last post by:
Hi there, I am quite new to Javascript and probably this is pretty trivial, so please be a bit patient with my ignorance. Currently I am wondering about a login.jsp with the following code: ...
3
by: arty | last post by:
So basically i have a form with a action attribute set to another form, it is a survey spread among several pages and using php sessions, now im trying to validate the form with Javascript but it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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,...
0
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...

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.