473,729 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

is it possible with in one form more than 1 submit buttons

121 New Member
Hi everybody,

Hi iam strugling with more than one submit buttons with in one form
here is my code

Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="Offer.php" name='issueFrm' onSubmit="return fullOfferfields();">
  2. OFFER <input type=image src="amarok_rewind.png " title="rewind" > <input type=image src="amarok_back.png" title="back"> <input type="text" size=3 name='txt'>&nbsp;<input type=image src="amarok_next.png " title="next" >&nbsp;<input type=image name='frwd' src=
  3. "amarok_fastforward.png" title="fastforward" value='submit' alt='fastforward'>
  4. <input type=submit name=ss value=Submit>
  5. </form>
  6.  
  7. once i clicked on image submit button it has to post some data.
  8. this one working on Mozilla browser what is the problem could you explain me
  9. and here is my entire code 
  10.  
  11.  
  12. code:
  13. <html>
  14. <body>
  15. <table>
  16. <tr height=1>
  17.    <td  width=100% align=center class="pageheader" background="sidebar.gif" colspan=8 cellpadding=0 cellspacing=0>
  18. <form method="post" action="Offer.php" name='issueFrm' onSubmit="return fullOfferfields();">
  19. OFFER &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
  20. ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  21. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  22. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  23. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  24. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  25. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  26. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  27. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  28. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  29. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=image src="amarok_rewind.png " title="rewind" > <input type=image src="amarok_back.png" title="back"> <input type="text" size=3 name='txt'>&nbsp;<input type=image src="amarok_next.png " title="next" >&nbsp;<input type=image name='frwd' src=
  30. "amarok_fastforward.png" title="fastforward" value='Submit' alt='fastforward'>
  31. </td>
  32. </tr>
  33. </hr>
  34. <?php
  35. #$cxn = mysql_connect("localhost","root","mysql");
  36. #$db = mysql_select_db("phoenixhrdb",$cxn);
  37. include_once("functions.php");
  38. $cxn = connect_to_db("vars.php");
  39. #echo $cxn;
  40. echo $_POST['frwd'];
  41. if(isset($_POST['frwd']) or !empty($_POST['frwd'])){
  42. $query="select Max(ID) as id from Offer";
  43. echo $query;
  44. $result=mysql_query($query,$cxn);
  45. $row=mysql_fetch_array($result);
  46. $id=$row['id'];
  47. #echo $id;
  48. $all_query="select * from Offer where ID='$id'";
  49. $all_result=mysql_query($all_query,$cxn);
  50. $all_row=mysql_fetch_array($all_result);
  51. $all_id=$all_row['Position_Name'];
  52. #echo $all_id;
  53. $all_client=$all_row['Client'];
  54. #echo $all_client;
  55. $all_candidate=$all_row['Candidate'];
  56. #echo $all_candidate;
  57. $all_desig=$all_row['Designation'];
  58. #echo $all_desig;
  59. $all_expdate=$all_row['Company_Exp_Doj'];
  60. $all_offer=$all_row['Offer_date'];
  61. #echo $all_offer;
  62. $all_offerctc=$all_row['offer_CTC'];
  63. #echo $all_offerctc;
  64. $all_status=$all_row['Status'];
  65. #echo $all_status;
  66.  
  67. }
  68. ?>
  69. <tr>
  70. <td colspan=7 width=100% height=100%>
  71. <table border=0 width=100% height=100%>
  72. <tr width=100% height=100%>
  73. <td colspan=7 width=80% height=100%>
  74. <table border=0 width=100% height=100%>
  75. <tr width=100% height=100%>
  76. <td width=25% height=100% valign=top>
  77. <SCRIPT language=JavaScript id=jscal1xx>
  78. var cal1xx = new CalendarPopup("testdiv1");
  79. cal1xx.showNavigationDropdowns();
  80. </SCRIPT>
  81.  
  82. <table width=95% align=center cellpadding=4 cellspacing=0 border=0>
  83. <tr><td></td></tr>
  84. <tr><td colspan=8 class="field" background="sidebar.gif"><u>Offer Details</u></td></tr>
  85.   <tr><td></td></tr>
  86. <tr><td class="field">Client Name <font color="red">*</font></td><td><select id='department'  name="CCode" onChange='load()' >
  87. <?php
  88.  
  89. #$cxn = mysql_connect("localhost","root","mysql");
  90.  
  91. #$db = mysql_select_db("phoenixhrdb",$cxn);
  92.  
  93. $CName_query = "select Client_Name from Client";
  94.  
  95. $CName_result = mysql_query($CName_query) or die("Could not connect to database".mysql_error($cxn));
  96.  
  97. while($Crow = mysql_fetch_array($CName_result)){
  98. $clientname[] = $Crow['Client_Name'];
  99.  
  100.  
  101.  }
  102. for($i=0; $i< sizeof($clientname); $i++)
  103.  
  104. {
  105.  
  106.         echo "<option value='$clientname[$i]'";
  107.  
  108.         if($clientname[$i] == @$_POST['CCode']){
  109.  
  110.                 echo "selected";
  111.  
  112.         }
  113.  
  114.         echo "> $clientname[$i]</option>";
  115.  
  116.  }
  117.  
  118.  
  119.  
  120. ?>
  121.  
  122.  
  123. </select>
  124.  
  125.   </td></tr>
  126.  
  127. <tr><td class="field">Position Name <font color="red">*</font></td>
  128.  
  129. <td>
  130.  
  131. <?php
  132.  
  133. echo ("<select  id='faculty', name='PCode' selected >");
  134. $n=$_POST{'PCode'};
  135. echo "<option value='$n'>";
  136.  
  137.         #             echo "selected";
  138.  
  139.  
  140.         echo " $n</option>";
  141.  
  142. echo ("</select>");
  143.  
  144. #iecho $n;
  145. ?>
  146.  
  147. </td></tr>
  148.  
  149. <tr><td class="field">Candidate Name <font color="red">*</font></td><td>
  150. <?php
  151.   $candquery = "select distinct Candidate_Name from Interview where  I_status='Confirmed' ;";
  152. $candresult = mysql_query($candquery,$cxn);
  153.   while($candrow = mysql_fetch_array($candresult)) {
  154.     $candname[] = $candrow['Candidate_Name'];
  155.   }
  156. ?>
  157. <select  name="canname" >
  158. <?php
  159. if(isset($_POST['frwd'])){
  160. echo"<option value='<?php echo $all_candidate;' ?>$all_candidate</option>";}
  161. $i=0;
  162. while($i<sizeof($candname)) {
  163.  
  164.         if($all_candidate==$candname[$i]){$i++;}
  165.       echo ("<option value='$candname[$i]'>$candname[$i]</option>");
  166. $i++;
  167.     }
  168. ?>
  169. </select>
  170. </td>
  171. </tr>
  172.  
  173. <tr><td class="field" >Designation </td><td>
  174.  
  175.  
  176.  <select  name="designation" >
  177. <?php
  178. include("designation.inc");
  179. ?>
  180. </td></tr>
  181. <?php
  182. if(isset($_POST['frwd'])){
  183. echo "<tr><td class='field'>Expected date of joining </td><td><input type='text' name='exdoj' size='7' readonly title='Select Date' value='$all_expdate'>";
  184. }
  185. else{
  186. echo "<tr><td class='field'>Expected date of joining </td><td><input type='text' name='exdoj' size='7' readonly title='Select Date'>";}
  187. ?>
  188. <a id=anchor2xx  onclick="cal1xx.select(document.forms[0].exdoj,'anchor2xx','dd/MM/yyyy'); return false;"
  189. href="http://www.mattkruse.com/javascript/calendarpopup/index.html#"
  190.  
  191. name=anchor2xx><img src="cal.gif"></img></a>
  192. </td></tr>
  193. <?php
  194. if(isset($_POST['frwd'])){
  195. echo "<tr><td class='field'>Offer date </td><td><input type='text' name='ofd' size='7' readonly title='Select Date' value='$all_offer'>";
  196. }
  197. else{
  198. echo "<tr><td class='field'>Offer date </td><td><input type='text' name='ofd' size='7' readonly title='Select Date'>";}
  199. ?>
  200. <a id=anchor1xx
  201.  title="cal1xx.select(document.forms[0].ofd,'anchor1xx','dd/MM/yyyy'); return false;"
  202.  onclick="cal1xx.select(document.forms[0].ofd,'anchor1xx','dd/MM/yyyy'); return false;"
  203. href="http://www.mattkruse.com/javascript/calendarpopup/index.html#"
  204.  
  205. name=anchor1xx><img src="cal.gif"></img></a> </td></tr>
  206. <tr><td colspan='2' align='right'></td></tr>
  207. <tr><td class="field">Offer CTC </td><td><select name="offctc" >
  208.  
  209. <?php
  210.   $i=0;
  211. if(isset($_POST['frwd'])){
  212. echo("<option value='$all_offerctc' selected>$all_offerctc</option>");}
  213.  
  214. while($i<=50){
  215.  
  216. #if(isset($_POST['frwd'])){
  217. #echo("<option value='$all_offerctc' selected>$all_offerctc</option>");}
  218. if($all_offerctc==$i){$i++;}
  219.   if($i==0) {
  220.  
  221.       echo ("<option value='$i'>Select</option>");
  222.   }
  223.   else {
  224. #for($i=0; $i<=sizeof($exp_salary); $i++) {
  225.  
  226.   echo ("<option value='$i'>$i</option>");
  227.  
  228. # }
  229.   }
  230. $i=$i+0.5;
  231.  }
  232.  
  233. ?>
  234. </select>
  235.  
  236. </td></tr>
  237. <tr><td class="field">Status </td>
  238. <td><select name="st">
  239. <?php
  240. if(isset($_POST['frwd'])){
  241. echo"<option value='$all_status' selected>$all_status</option>";
  242. }
  243. $a=0;
  244. $arr=array("Accepted","Rejected","Joined");
  245. while($a<sizeof($arr)){
  246. if($all_status==$arr[$a]){$a++;}
  247. echo"<option value='$arr[$a]'>$arr[$a]</option>";
  248. $a++;
  249. }
  250. ?>
  251. </select>
  252. </td></tr>
  253.  
  254. <tr><td></td></tr>
  255. <tr><td colspan=3 align=center><input type="submit" name="offersubmit" value="Submit"></td></tr>
  256.  
  257. </table>
  258. </form>
  259.  
  260. <tr height=15><td  align=center background="sidebar.gif" colspan=8 cellpadding=0 cellspacing=0 class=footertxt>copyright2007 @ phoenixhrsolutions</td></tr>
  261. </table>
  262.  
  263. </body>
  264. </html>
  265.  
Oct 16 '07 #1
2 1928
ronverdonk
4,258 Recognized Expert Specialist
Next time enclose any code within the proper code tags. See the Posting Guidelines on how to do that.

moderator
Oct 16 '07 #2
Yardgnome
6 New Member
In your code you are using isset['frwrd'] to check if the image button was clicked. When you are using that type of button, the post value, at least in Firefox, is not called frwrd. There are two post values frwrd_x and frwrd_y which indicate the location on the image where the user clicked. You could change your input type to a submit button and style it's appearance if you'd like to avoid rewriting some of your PHP code.
Oct 16 '07 #3

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

Similar topics

12
2414
by: Roger Price | last post by:
Thank you to Yang (Is that your first name?) and Andy for your suggestions. I am 99% of the way there but now cannot get the "Reset" button to work. I have included the whole of my code and would appreciate it if someone could explain where I am going wrong. TIA Roger
2
1866
by: Matt | last post by:
The problem is I have 3 buttons that need to submit the form to different URL. My approach is to declare <input type="submit"> rather than <input type="button">. And put the following in the JavaScript: InputForm.action="URL LOCATION" InputForm.method="POST"; I think we don't need InputForm.submit(); because <input type="submit">.
3
1995
by: Tom Asken | last post by:
Short version: IE 6.0 wrongly posts <button ..> value. Internet Explorer should only post the value of the clicked submit button - but IE 6 posts the value of several submit buttons if they have the same name Long version: I have a form with several Buttons with the same name and different values. According to the w3c only successful controls supposed to be submitted:
4
5955
by: Felipe Gasper | last post by:
I'm trying to set up an HTML table such that each row can have its own HTML form that spans multiple cells. Does anyone know a standards-compliant way of doing this? -Felipe Gasper -- Quidquid latine scriptum sit altum viditur.
1
2797
by: Matt | last post by:
The problem is I have 3 buttons that need to submit the form to different URL. My approach is to declare <input type="submit"> rather than <input type="button">. And put the following in the JavaScript: InputForm.action="URL LOCATION" InputForm.method="POST"; I think we don't need InputForm.submit(); because <input type="submit">.
3
1924
by: M | last post by:
i am using submit buttons to send the user to different parts of a wizard. i am using if (if attribute.step1 exists) statements to send them to the appropriate section based on which submit button they pressed. well i would like to change these submit buttons into text links instead. however they do not pass form parameters like the submit button. any simple ways to accomplish this? this is what i have so far:
13
1985
by: axlq | last post by:
How do I create a form that two submit buttons, where each one submits the form input data to a different server? Consider this situation: I have a form where users can check various options to subscribe to a service, and each option costs a certain amount. When the form is submitted, my php script totals up the options. Fine. The form has 2 submit buttons: "print invoice" and "pay by credit card."
16
2874
by: browntown | last post by:
so I have this application I'm nearly finished with. The only thing the client has requested is the ability to submit the form by pressing "enter". I didn't think this would be a huge pain in the ass and the app will be used internally so I'm not too worried about users who aren't using javascript. I'm using the following javascript to detect whether or not they've hit enter: if(document.layers) {
13
3432
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end of the form which is submit and cancel. After i have clicked submit, the information is stored directly into my corresponding database table. My problem here is i need to retrieve back the information submitted to display all the data that the...
0
8761
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
9281
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
9200
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
8148
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
6722
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
4525
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...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
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
2680
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.