473,789 Members | 2,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to get the values in the textboxes when a radio button is selected?

10 New Member
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.   <head>
  3.     <h2 align=center>Blank Tapes Status Form</h2>
  4.  
  5. <br><title>Blank tapes status</title>
  6. </head>
  7.  
  8. <body>
  9.   <br><br>
  10.   <form name=tapes_status method=post>
  11.  
  12.  
  13. <center>
  14.    <fieldset style='width:40%'><legend>Blank_Tapes_Status_Form</legend>
  15.  <table align=center border=1 >
  16.    <tr><td><font face=Verdana size=3><b>Channel</b></font></td>
  17.   <td><input type=channeltextbox size=20 id=channels readonly name=channels style="width:100px" value="<?php echo $ChannelName?>"></td>
  18.  
  19.  
  20.   <td><font face=Verdana size=3><b>Total Recieved</b></font></td>
  21.   <td><input type=totalrecievedtextbox size=20 id=totalrecieved name=totalrecieved style="width:100px" onclick=Total_recieved_tapes()></td>  </tr>
  22.  
  23.  
  24.    <tr><td><font face=Verdana size=3><b>Format</b></font></td>
  25.    <td><select id=format name=format size=1 style="width:155px">
  26.    <option>[Select One]</option><?php Format();?>
  27.  
  28.    </select></td>
  29.  
  30.     <td><font face=Verdana size=3><b>Total Issued</b></font></td>
  31.   <td><input type=totalissuedtextbox size=20 id=totalissued name=totalissued style="width:100px" onclick=Total_issued_tapes()></td></tr>
  32.  
  33.  
  34.         <td><input type=radio id=optStatus checked name=optStatus style='width: 40px height: 20px' onclick=fnReload("B")>Blank <br></td>
  35. <td><input type=radio id=optStatus name=optStatus style='width: 40px; height: 20px' onclick=fnReload("R")>Re-Use</td>
  36.         <td><font face=Verdana size=3><b>Available Tapes</b></font></td>
  37.         <td><input type=textbox size=20 id=availabletapes name=availabletapes style="width:100px" onclick=Available_tapes()></td>
  38.         </tr>
  39. </table>
  40. </center>
  41. </fieldset>
  42.  
  43.         <?php ReUse_Details(); ?>
  44.  
  45.  
  46. <!--</fieldset>-->
  47.  
  48.  
  49. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br><br><br><br>
  50.  
  51.  
  52. <?php
  53. function Format()
  54.  
  55.  {
  56.         $dbconnect=pg_connect("host=10.10.1.3 dbname=Tape_Library  user=postgres password=post123") or
  57.          die("could not connect to the database");
  58. $query = "select tms003_typecode,tms003_typename from tms_master_tapformat";
  59.  
  60.                 $result = pg_query($query) or die ("Could not Open Records") . pg_last_error();
  61.  
  62.                 while($row = pg_fetch_row($result))
  63.                 {
  64.  
  65.                         echo "<option value='" . $row[0] . "'>";
  66.                         echo $row[1];
  67.                         echo "</option>";
  68.                 }
  69.                 pg_free_result($result);
  70.  }
  71.  
  72.  
  73. function ReUse_Details()
  74. {
  75.  
  76.     $dbconnect = pg_connect("host=10.10.1.3 dbname=Tape_Library user=postgres password=post123") or
  77.         die('Could not Open COnnection...') . pg_last_error();
  78.   $query=" select distinct(tms010_barcode),tms010_reassign_count,tms021_assign_date from
  79.                         tms_trans_tapesassign_details left outer join tms_trans_reassign_details on
  80.                         tms010_barcode=tms021_barcode and tms021_channel_id=tms010_channel_id
  81.                         where  tms010_channel_id='H0002' and tms010_tapeformat_id= '2'
  82.                         and  tms010_available_flag='Y' ";
  83.  
  84.                 if ($_GET['status'] == "B")             //Blank
  85.                 {
  86.                         $query = $query . " and tms010_balnk_flag='Y'";
  87.                         $query = $query . " and tms010_reassigned_flag='N'";
  88.                 }
  89.                 else
  90.                 if ($_GET['status'] == "R")             //Reuse
  91.                 {
  92.                         $query = $query . " and tms010_reassigned_flag='Y'";
  93.                 }
  94.                 $query = $query . " and tms010_content_flag='N'";
  95.                 $query = $query . " and tms010_delete_flag='OK'  ";
  96.  
  97.         $result = pg_query($query) or die('Could not Open Recordset...') . pg_last_error();
  98.  
  99.         echo"<br><br><br><br><br>";
  100.  
  101.         echo "<table border=1 align=center>";
  102.         echo "<tr><th>SR.NO</th>";
  103.         echo " <th>Tape Number</th>";
  104.         echo " <th>Date</th>";
  105.         echo "</tr>";
  106.  
  107.         $count = 1;
  108.         while($row = pg_fetch_row($result))
  109.         {
  110.         echo "<tr><td>" . $count . "</td>";
  111.                 echo "<td>" . $row[0] . "</td>";
  112.                 echo "<td>" . $row[1] . "</td>";
  113.                 echo "</tr>";
  114.                 $count++;
  115.  
  116.         }
  117.  
  118.        $query="SELECT * FROM tms_trans_reassign_details where tms021_channel_id='H0006' and tms021_channel_assign_to='H0005' and tms021_tapeformat_id='2' ";
  119.  
  120.         echo "</table>";
  121.  
  122.         pg_free_result($result);
  123.         pg_close($dbconnect);
  124.  
  125. }
  126.  
  127.  
  128. function Blank()
  129.  {
  130.  
  131.    $dbconnect = pg_connect("host=10.10.1.3 dbname=Tape_Library user=postgres password=post123") or
  132.         die('Could not Open COnnection...') . pg_last_error();
  133.  
  134.      $query = "select sum(tms019_no_of_tapes_issue_rec) as temp from  tms_trans_closing_balance where tms019_channel='H0006' and tms019_tape_format='CD-R' and tms019_status='ISU' ";
  135.  
  136.         $result = pg_query($query) or die('Could not Open Recordset...') . pg_last_error();
  137.  
  138.         echo"<br><br><br><br><br>";
  139.  
  140.         echo "<table border=1 align=center>";
  141.  echo "<tr><th>SR.NO</th>";
  142.         echo " <th>Tape Number</th>";
  143.         echo " <th>Date</th>";
  144.         echo "</tr>";
  145.  
  146.         $count = 1;
  147.  
  148.          while($row = pg_fetch_row($result))
  149.         {
  150.  
  151.                 echo "<tr><td>" . $count . "</td>";
  152.                 echo "<td>" . $row[0] . "</td>";
  153.                 echo "<td>" . $row[1] . "</td>";
  154.                 echo "</tr>";
  155.                 $count++;
  156.          }
  157.                   echo "</table>";
  158.  
  159.         pg_free_result($result);
  160.         pg_close($dbconnect);
  161.  
  162.  
  163.  }
  164.  
  165. ?>
  166.  
  167.  <br><br><br><br>
  168. <table align=center><tr><td>
  169.  <input type='submit' name='exit' id='exit' value='EXIT'  style="width:75px" onclick='window.close()'><td></tr></table>
  170.  
  171. </form>
  172. <script language=javascript>
  173.  
  174.         var stat = "<?php echo $_GET['status']; ?>";
  175.  
  176.         if (stat == "B")
  177.         {
  178.                 tapes_status.optStatus[0].checked = true;
  179.         }
  180.         else
  181.         {
  182.                 tapes_status.optStatus[1].checked = true;
  183.         }
  184.  
  185.         function fnReload(stat)
  186.         {
  187.  
  188.                 var redir = "blank_tapes_status.php?status=" + stat;
  189.  
  190.                 alert(redir);
  191.  
  192.                 window.open(redir, "_top");
  193.         }
  194.  
  195.  
  196.  
  197.         function Total_recieved_tapes()
  198.         {
  199.                  var recieved_tapes = tapes_status.optStatus.value;
  200.                 tapes_status.totalrecieved.value = recieved_tapes;
  201.  
  202.         }
  203.  
  204.        function Total_issued_tapes()
  205.  {
  206.  
  207.                 var issued_tapes = tapes_status.optStatus.value;
  208.                 tapes_status.totalissued.value = issued_tapes;
  209.  
  210.         }
  211.           function Available_tapes()
  212.           {
  213.  
  214.                  var aval_tapes = tapes_status.optStatus.value;
  215.                 tapes_status.availabletapes.value = aval_tapes;
  216.           }
  217.  
  218. </script>
  219.  
  220. </body>
  221. </html>
  222.  
Hi,any one help me,when i select a reuse radio button i have to get total recieved tapes,total issued tapes,total available tapes into the textboxes.
Jun 5 '09 #1
3 3661
Atli
5,058 Recognized Expert Expert
Hi.

First of all, your markup is a mess. (No offense)
You should really use the W3C validation page to clean it up a bit.

You may also want to read up on CSS to get rid of those ancient <font> tags, and to further clean up the markup.

As to the question...

Could you please explain this a little better, and perhaps show us exactly where in all that code your problem is occurring. (It's a lot of code)
Jun 5 '09 #2
kiranbabu
10 New Member
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <td><font face=Verdana size=3><b>Total Recieved</b></font></td> 
  4.   <td><input type=totalrecievedtextbox size=20 id=totalrecieved>
  5.  
  6. td><font face=Verdana size=3><b>Total Recieved</b></font></td> 
  7.   <td><input type=totalrecievedtextbox size=20 id=totalrissuedd >
  8.  
  9. td><font face=Verdana size=3><b>Total Recieved</b></font></td> 
  10.   <td><input type=totalrecievedtextbox size=20 id=total available> 
  11.  
  12. td><input type=radio id=optStatus checked name=optStatus style='width: 40px height: 20px' onclick=fnReload("B")>Blank <br></td>
  13.  
  14. <script language=javascript> 
  15.  
  16. function Total_recieved_tapes() 
  17.         { 
  18.                  var recieved_tapes = tapes_status.optStatus.value; 
  19.                 tapes_status.totalrecieved.value = recieved_tapes; 
  20.  
  21.         } 
  22.  
  23.        function Total_issued_tapes() 
  24.  { 
  25.  
  26.                 var issued_tapes = tapes_status.optStatus.value; 
  27.                 tapes_status.totalissued.value = issued_tapes; 
  28.  
  29.         } 
  30.           function Available_tapes() 
  31.           { 
  32.  
  33.                  var aval_tapes = tapes_status.optStatus.value; 
  34.                 tapes_status.availabletapes.value = aval_tapes; 
  35.           } 
  36.  
  37. </script> 
  38.  
  39. </body> 
  40. </html> 

when i select radio button i have get the total recieved,total issued,total available tapes in their textboxes.i am using postgresql database.how to get the data in the textboxes.
Jun 6 '09 #3
code green
1,726 Recognized Expert Top Contributor
If you are using Javascript you need something like
Expand|Select|Wrap|Line Numbers
  1. document.YourFormName.YourTextBoxName.value = "Write value here";
Jun 8 '09 #4

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

Similar topics

2
9810
by: entoone | last post by:
I am able to make a selection of information when entering a record, with radio buttons giving the option of yes, or no. Which stores their answer as yes, or no in the database. I then have an update record page that reads information in the database, and presently it will not retrieve the previously selected option from the database. I have tried all sorts of if else statements, and can't get anything to work. I want the previously...
4
2577
by: cwwilly | last post by:
Hello, Thanks for taking a look at this! Problem: I'm trying to pass multiple dynamic values between a slaveform and a masterform. The problem I'm having is on the slaveform I loop through multiple records and want two values depending on the row they select. slaveform: x=selected
1
4256
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES is selected - enable a field to use the M$ Datepicker. Using the code below works for most of our fields, however the problem is that when the field is re-enabled - it remembers the original date or data prior to it being disabled - despite the...
1
47853
by: Rage Matrix | last post by:
Hi all, I have a small problem with Access radio button groups in VBA. I've got a radio button group called fraSearchMode with three radio buttons in it. At a certain point, I want to see which radio button is selected and store the value (1, 2 or 3) in a Byte variable. Now, I assumed that this was a simple case of choosing the button you wanted and checking the fraSearchMode.Value property for value 1, 2 or 3. Apparently this is not so....
3
3542
by: Alpha | last post by:
I have 3 radio buttons for include, exclued or 'select all' from the listbox items. If a user selects the 'Select All' button' then all items in listbox is hi-lited as selected. Now, when user selects one item out of the 'all selected' listing then there is now only one item selected. How and where can I put in some code to change the selected radio button to the 'include' since it is no longer in select all mode. Thanks, Alpha
3
1503
by: Mark | last post by:
Hi, I have an aspx page, that in the PageLoad sub, gets values from a specific record in a database as where the record id is retrieved from the querystring. Thesee values are then used to populate a series of text boxes, radio button selections and drop down list selections. This all works. I run into a problem when I change the values of one of these populated items. When a button is clicked to update the database with the modified...
1
1918
by: Dave Harris | last post by:
I am a raw newbie to VB.NET trying to convert a data processing QuickBasic program into .NET. I have about 14 forms, the first of which has a bank of radio buttons identifying the airline. The second bank of radio buttons identifies the aircraft model, and the third bank of radio buttons lets the user choose between two processes. I am using public properties to get and set the values for these three sets of radio buttons. Once these values...
5
2156
by: Mirovk | last post by:
The onclick action associated to my form´s radio buttons call to a vbscript were the session values are changed, this happens correctly but with the onclick action associated to my continue button always shows the value =1 instead the values selected under my radio buttons (Values= 4,3 or 1) I am showing the code. Ideas welcome.
8
2983
by: crayfiss | last post by:
Hi, firstly I am a total freshie in all this. From what I have gathered on the web and this forum, I finally managed to get my form up. I have a set of radio buttons with values to it and a select box with values too. Depending on the options selected from the two, the values will be calculated and displayed. everything worked fine with the calculation and im getting the right amount totalled up. I only have one issue, whenever the radio...
0
9511
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
10404
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
9979
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
9016
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...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
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
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
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
3695
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.