473,699 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

action url change on submit form

MZ
Hello!

Is it possible to change URL form action on submit form...

I have tried such code:
<script language="JavaS cript" type="text/javascript">
function changeURL()
{
document.locati on='http://www.XXX.com/'+'?dzial='+doc ument.getElemen tById('dzial'). value+'&pdzial= '+document.getE lementById('pdz ial').value;}</script><form name="formularz " id="formularz" method="post"ac tion="http://www.XXX.com/" onKeyUp="sprawd zajForm_spec(); " Dept:<input name="dzial" id="dzial" size="10" maxlength="9" type="text"valu e="11" Subdept:<input name="pdzial" id="pdzial" size="10" maxlength="9"ty pe="text" value="b" <input id='sendOgl' style="display: none;" type="button"on click="changeUR L();wyslij();" value="Wyslij ogloszenie" class="wyslijOg l"></form>but it doesn`t work well and it didn`t change my URL form action .Thank you in advance for any commentsKindest regardsM.

May 23 '07 #1
1 21882
MZ wrote:
Hello!

Is it possible to change URL form action on submit form...

I have tried such code:
<script language="JavaS cript" type="text/javascript">
function changeURL()
{
document.locati on='http://www.XXX.com/'+'?dzial='+doc ument.getElemen tById('dzial'). value+'&pdzial= '+document.getE lementById('pdz ial').value;}</script><form
name="formularz " id="formularz" method="post"ac tion="http://www.XXX.com/"
onKeyUp="sprawd zajForm_spec(); " Dept:<input name="dzial" id="dzial"
size="10" maxlength="9" type="text"valu e="11" Subdept:<input
name="pdzial" id="pdzial" size="10" maxlength="9"ty pe="text" value="b">
<input id='sendOgl' style="display: none;"
type="button"on click="changeUR L();wyslij();" value="Wyslij ogloszenie"
class="wyslijOg l"></form>but it doesn`t work well and it didn`t change my
URL form action .Thank you in advance for any commentsKindest regardsM.
Hi,

Your posting came through scrambled in my newsreader.
But to change the action is a form is easy:

<form action="script1 .php" name="myForm">
<input type="text" name="firstname ">
<input type="submit" value="submit to original script">
<input type="button" value="submit to script2.php"
onClick='docume nt.forms.myForm .action="script 2.php";
document.forms. myForm.submit() ;'>
</form>

Regards,
Erwin Moller
May 23 '07 #2

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

Similar topics

1
2040
by: Dave | last post by:
Hello I am running Windows XP Pro with IIS 5.1 intalled. When I submit a page to itself, it works. When I call another page in the form action, it doesn't. The original page seems like it refreshes.....no error, no change. For example, when I run this as "submitpage.asp", and the form action page("billybob.asp") does not exist, submit page justs refreshes. The same thing happens when I
3
1980
by: Michele | last post by:
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...
7
2517
by: TJS | last post by:
what is wrong here, the submit will only post page back to itself instead of specifed action <SCRIPT language="Javascript"> function Submit_Form(){ document.Form1.Action="cart.asp"; document.Form1.submit(); return false; } </SCRIPT>
6
13389
by: tencip | last post by:
Hi everyone, So, i've got a form that is very simple. It hold three elements: username, password, and domain. The goal here is to have the form submit the login to an administrative section depending on which domain someone has chosen. For instance, let's say we have three administrative sites, that all have different URLs, but we want this one form to handle logging into any of them. So, the form itself needs to have a dynamic action
2
9687
by: belgie | last post by:
Whereas in Asp I could submit my form contents to any other Asp page, it appears that in Asp.NET the primary Asp form will only submit to itself. I have tried changing the Action attribute in the Form tag, but it changes itself back when compiled. I have also tried changing the form Action attribute in client-side javascript prior to submitting the form, but I get this error: The View State is invalid for this page and might be...
4
4264
by: Jiho Han | last post by:
What is the best way to check whether the page is simply a postback or the form has been submit with the intention of doing something? In the olden days, I used to check for a form field name used for the submit button: <input type="submit" name="saverecord" value="push me to save"> Then I'd retrieve it using something like:
4
2791
by: Mark Miller | last post by:
I've been trying to execute a javascript function just before submit on a form that contains an <input type="file"> input field and it isn't working. The reason I want to do this is the end users will be uploading files that are between 1 and 2 Meg. in size, and they are not too knowledgeable about computers. I want to disable the form buttons so they can't hit them after they hit the "upload" button. We're trying to prevent them from...
6
5085
by: Stanimir Stamenkov | last post by:
I have a form without a submit button like: <form name="form1" action="" onsubmit="alert('submit ' + this.name);"> <div> <label>Field 1: <input type="text" name="field1" onchange="alert(this.name + '=' + this.value);"></label></div> <label>Field 2: <input type="text" name="field2" onchange="alert(this.name + '=' + this.value);"></label></div> </form>
9
1741
by: Meendar | last post by:
Hi, Below is my code snippet having only one form, <form> <input type ="radio" name="action" value="xyz" checked>xyz <input type ="radio" name="action" value="zyx">zyx <input type ="radio" name="action" value="yxz">yxz </form>
0
8686
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
9173
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...
0
9033
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8882
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
7748
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
6533
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
4375
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...
2
2345
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.