473,797 Members | 3,204 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

to go to another page by clicking a button in html

17 New Member
in html we go another page by
using this
<form action="one.htm l">
but i have to do go to another page after clciking a button....ie if i click different buttons the ni shuld go to different page. but in form tag we can go only to one form but i want to go to multiple form after a button click.

ie i want to insert in the backend, also update in backend delete etc...
therefore if i click insert button then i shuld go to insert form
if i delete button i shuld go to delete form...

.ie i shuld go to form on button click
Apr 2 '08 #1
2 19234
dasrasmikant
30 New Member
I think this will fulfil your requirement

Expand|Select|Wrap|Line Numbers
  1. function delete()
  2.     {
  3.        document.formName.action="delete.html";
  4.        document.formName.submit();
  5.     }
then add this function in the button you want
Apr 2 '08 #2
hsriat
1,654 Recognized Expert Top Contributor
That can be achieved in two ways.

First:
Change the action of the form depending upon the submit button to click.
For that, add similar code to each submit button for different files, update.php, delete.php etcetera[html]<input type="submit" name="update" value="Update" onclick="docume nt.forms[0].action = 'update.php'; return true;">[/html]

Second:

On the server side, you can write the whole code in a same file and divide it according to the submit button clicked.
eg.[php]<?php
if (isset($_POST['update']))
{
//WRITE CODE FOR UPDATE
}
elseif (isset($_POST['delete']))
{
//WRITE CODE FOR DELETE
}
else
{
die('Invalid request');
}[/php]
Where update and delete are the names of the submit buttons.
If you are not using PHP, I hope you can translate it to your required language.
Apr 2 '08 #3

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

Similar topics

12
6559
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html I am passing countries, products, and courses. The first two display
1
3797
by: Zaidan | last post by:
I am running Excel2000 under WIN98 2nd edition, and I am writing a VBA code (I will consider using javascript if I have to) that does the following, at the user command: 1- Start MS Explorer and go to my website. Login (enter ID and Password) 2- It will go and update some prices of some products that I sell 3- It will add new products or cancel some product I already have someone who wrote me in JavaScript a web form (no documentation...
2
3827
by: anonieko | last post by:
Scenario: You have a page that is TOO slow to refresh. But it allows partial flushing of html contents. I.e. Submit button already appears but you don't want your users to click on it prematurely because other parts are still coming. Here I put a javascript the will enable only submit button only after 5 seconds after the page is load fully.
7
2006
by: Matt | last post by:
Hi all, Not very sure about this. I have one button (not a submit button) will "post" partial page(form) info to another url(the user will also redirect to this url :-). I dont' want to change the webpage interface, so how can I POST partial form info? by using a tmp url??? TIA
15
4781
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
8
3355
by: rn5a | last post by:
I have a HTML page named Index.html which is divided into 3 frames. The URL of 2 of the frames are HTML pages but the 3rd frame houses a ASP page. Now when I go to Windows Explorer, navigate to the folder in which the all the 4 files (3 HTML + 1 ASP) reside & select Index.html (by clicking with the mouse or by using the arrow keys on the keyboard), strangely the Windows "File Download" dialog box (with 'Open', 'Save', 'Cancel', 'More...
16
47339
nirmalsingh
by: nirmalsingh | last post by:
hai experts, i am having page called main.html, when the user clicks a button in this page a popup window of pop.html is opened. in pop.html user enter his name and close that popup window. now what i need is: the name entered in pop.html shiould be shown as table format in main.html. the row should be added each and every time the user open and enter a name. without refreshing main.html. what should i do for this.
1
1705
by: SUHASbioinfo | last post by:
Hi All, I have created two web pages (Login page & User Page), Login page has a form of which method is get & action is "\\localhost\login.pl" , and submit button (action = submit), This login page will accept user & password from user & on clicking Submit button it will cross check it with database, if both user & password are correct it will print "Login Successful" on a different web page, up to this I have done successfully, But now...
0
9685
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
9537
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
10246
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...
1
10209
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10023
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
9066
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
7560
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...
1
4135
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
3750
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.