473,396 Members | 1,768 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,396 software developers and data experts.

Form Action

Hi i have the following code;

Expand|Select|Wrap|Line Numbers
  1. <br>FanIn:
  2. <form action = "faninon.php " method ="post"> <input type = "submit" value="ON"/> </form>
  3. <form action = "faninoff.php " method ="post"> <input type = "submit" value="OFF"/> </form>
  4. </br>
this display the buttons one above the other, how can i put them side by side.

Thank you
Apr 9 '09 #1
8 2387
Dormilich
8,658 Expert Mod 8TB
there are (like always) several ways to accomplish that.
  • use only one form and 2 submit buttons. change the action attribute onsubmit through Javascript
  • float the forms
  • position them (absolute or relative)
  • play with the margins
Apr 9 '09 #2
acoder
16,027 Expert Mod 8TB
Yet another option: one action page and use radio buttons for Yes and No and one submit button.
Apr 9 '09 #3
Hello thanks for your responce, i will look into putting radio buttons as my final design needed that.But i am not sure i know how to send the correct value associated with it.
My final version of the wed page was to do this---

The "index.php" page redirects me to lighton1.php when i click the ON button. When i go to "lighton1.php" the page runs a script and it finishes.
what i want to do is rather than creating another page lightoff1.php, I have one page let say Inprogress.php which receives a value from "index.php" say "L11" and parses that $varname to the ./dosomething.out .$varname.

And once it finishes it redirects the back to the index.php.

let me know if you know how to do this.
I really appreciate your help. thanks
------------------------------------------------------------------------------------------------------------------

Expand|Select|Wrap|Line Numbers
  1. index.php
  2.  
  3. <html>
  4. <body>
  5.  
  6.  
  7. <br>Light1:
  8. <form action = "lighton1.php " method ="post"> <input type = "submit" value="ON"/> </form>
  9. <form action = "lightoff1.php " method ="post"> <input type = "submit" value="OFF"/> </form>
  10. </br>
  11.  
  12. </body>
  13. </html>
  14.  
Expand|Select|Wrap|Line Numbers
  1. lighton1.php
  2.  
  3. <html>
  4. <head/>
  5. <body>
  6. <h2> Success </h2>
  7. <?php 
  8. print 'Light is turned ON';
  9. $var_name = "L11";
  10. echo shell_exec("./send.out ".$var_name);
  11. ?>
  12. </body>
  13. </html>
  14.  
Apr 9 '09 #4
David Laakso
397 Expert 256MB
Right forum. Wrong board. (X)HTML/CSS does not deal with behavior.
Apr 9 '09 #5
acoder
16,027 Expert Mod 8TB
Yes, you need to ask your question in the PHP forum.
@poisonvm
This is done automatically by the browser. If a value is selected, this is passed onto the next page when submitted. In your PHP page, check the value posted/submitted (or if it's even set).
Apr 10 '09 #6
Thanks guys................
Apr 10 '09 #7
-----------------------------------------------------------------------------
Apr 29 '09 #8
acoder
16,027 Expert Mod 8TB
Was there something you wanted to say?
Apr 30 '09 #9

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

Similar topics

5
by: bissatch | last post by:
Hi, I have been trying to come up with an idea to reduce double submissions where a user clicks refresh and, for example, another row is INSERT into a table. Originally, I would have a form...
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: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
6
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...
2
by: Myk Quayce | last post by:
I have a small .aspx page that uses old style forms with client-side JavaScript validation. Everything works fine until I try to upate the database with some new information. I must be doing...
4
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label...
13
by: deko | last post by:
I have a basic feedback form with a submit button. After the "send" button is clicked, I want the user to be redirected to a different page that says "Your message has been sent." How do I do...
6
by: Arthur | last post by:
Hello. How might it be possible to change where a form action is directed based on a selected option. For example I have this: <FORM METHOD = "post" ACTION = ""> And a drop down such as
12
by: Daniel Klein | last post by:
I'm pretty new at php and web stuff so please be gentle with me. I'm trying to get a form to submit when the user presses the Enter key. I do not want to use javascript. I've googled this to...
1
by: chromis | last post by:
Hi, I'm having trouble fully implementing the edit section of a contact admin system, so far I have written the following: - Bean (Contact.cfc) - Data Access object (ContactDAO.cfc) - Gateway...
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: 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: 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...
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,...
0
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...
0
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...
0
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,...

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.