473,387 Members | 1,722 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.

how set action dynamically

6
Hi.. i have two buttons on form update and submit and i want to send different actions by clicking on them using javascript but it does not work

function update()
{
document.formname.action="update.php";
document.formname.submit;

}
function add()
{
document.formname.action="update.php";
document.formname.submit;

}


<input type="submit" name="submit" value="Update" onclick="update()">
<input type="submit" name="submit" value="Add" onclick="add()">

anyone plz help me how i submit a form using javascript
Jul 4 '07 #1
1 1208
kovik
1,044 Expert 1GB
You are making them both do the exact same thing.

And to submit, you have to call it as a function, not an object.

Expand|Select|Wrap|Line Numbers
  1. document.formname.submit();
Jul 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sylvie Stone | last post by:
Hi group - I have an html form for that uses username and password to login to a specific area of the website. The "area" the user wants to go to is based on a pull down menu. Becasue the...
17
by: abs | last post by:
My element: <span onclick="alert('test')" id="mySpan">test</span> Let's say that I don't know what is in this span's onclick event. Is it possible to add another action to this element's onclick...
3
by: Darren | last post by:
Hi i have this code var newsTab=document.getElementById("newsTab"); newsTab.href="latestTabClosed.gif"; where "newstab" is an Image placeholder <img name="newsTab" id="newsTab" src=""...
2
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...
4
by: Kevin Blount | last post by:
bit long winded this one, so stick with me: I'm trying to create a form that can go to one of 3 places, depending on various elements. My form control looks like this: <form runat="server"...
0
by: Rahul | last post by:
Hi I have a Project A that is being reffered by another WEB project Webber. In Project A i am using a resx file to store some information in it. I have m1de the Build Action of the Resx file to...
2
by: Steven Nagy | last post by:
Hi all, I have the following file: ~/cms/page.aspx Normally, if you hit a url like http://localhost/MyApp/cms/page.aspx?PageID=32 ... this would load content dynamically. No big deal, this is...
9
by: eric | last post by:
I'm trying to define a dictionary whose value is an Generic Action<> delegate private Dictionary<string, List<Action<T>>> Any ideas on to how specify T or a different collection type more...
2
by: newlearner | last post by:
Hi all, is there any way to set focus for a HTML component from action class in JSF frame work. The Requirement is I validate a input text using a4j . if there is a validation error then i...
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: 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
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
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,...

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.