JavaScript - Need To Push A Button Please Help
Code:
<td class="x-btn-mc"><em class="" unselectable="on"><button class="x-btn-text " type="button" style="position: relative; width: 49px;" tabindex="0" aria-describedby="x-auto-5" aria-disabled="false">Next<img onload="this.__gwtLastUnhandledEvent="load";" src="http://tweepi.com/js/tweepigxt/clear.cache.gif" style="width: 16px; height: 16px; position: absolute; left: 0.15625px; top: 0px; background: url(http://tweepi.com/js/tweepigxt/67791A54F68E6C387B9AEF4E96FFB252.cache.png) -274px 0px no-repeat;" border="0" role="presentation" class=" x-btn-image"></button></em></td> I have tried this: Code: document.getElementsByid('x-auto-51').click() document.getElementsByClassName('x-btn-text ').click() Similar TutorialsHi.. I have some code I wrote a while ago and now I can't remember what it does! Code: var subArray = []; subArray[0] = frontEndOptionsId; subArray[1] = document.getElementById(frontEndOptionsId).value; BYOT5.push(subArray); And further down I have... Code: xh.sendRequest("GET","/byot5.php",BYOT5,callback,false); Am I right in guessing that the 'push' pushes the elements in subArray in to BYOT5 in my second segment? Would it look like... Code: xh.sendRequest("GET","/byot5.php",subArray("ZERO","ONE"),callback,false); ...when it's sent to byot5.php? Or am I completely wrong?! Hi, Im new to javascript. I want to add a similar function on my blog like on http://techcrunch.com/2011/08/04/gro...tartup-obtiva/ when you press on author. It is a drop down made with javascript. Anybody can help with a similar javascript as I was trying different implementations for the whole night with no luck. Maybe, anybody know a similar javascript online which I could modify? Thanks in advance! Hi there This is basically what I want to do: I want to have a slideshow that reads content of a folder and then shows the pictures and has a little fade animation between each image transition. to achieve this: I've done the following: 1. I'm using a php script to read the contents of a folder and spits out results in an array that I can use with my java script 2. im using jquery.cycle plugin to add the "fade" effect. Now my problem is My images are shown but i cant get the fade animation to work on my images. here is how my code looks like: My php file: PHP Code: <? //PHP SCRIPT: getimages.php header('content-type: application/x-javascript'); //This function gets the file names of all images in the current directory //and ouputs them as a JavaScript array function returnimages($dirname="./images") { $pattern="(\.jpg$)|(\.png$)|(\.jpeg$)|(\.gif$)"; //valid image extensions $files = array(); $curimage=0; if($handle = opendir($dirname)) { while(false !== ($file = readdir($handle))){ if(eregi($pattern, $file)){ //if this file is a valid image //Output it as a JavaScript array element echo 'galleryarray['.$curimage.']="'.$file .'";' . "\n"; $curimage++; } } closedir($handle); } sort($files); return($files); } echo 'var galleryarray=new Array();' . "\n"; //Define array in JavaScript returnimages() //Output the array elements containing the image file names ?> My html file: Code: <html> <meta http-equiv="refresh" content="1000"/> <head> <title>Media Signage Slideshow</title> <style type="text/css"> .pics { height: 232px; width: 232px; padding: 0; margin: 0; } .picsimg { padding: 0px; border: 0px solid #ccc; background-color: #eee; width: 200px; height: 200px; top: 0; left: 0 } #slideshow { height: 100%px; width: 100%px; margin: auto } #slideshow img { padding: 15px; border: 1px solid #ccc; background-color: #eee; } #slide {width: 370px; height: 220px; padding: 0; margin: 0 auto; } #myslides { width: 370px; height: 220px; padding: 0; margin: 0 auto; } #myslides img { padding: 10px; border: 1px solid rgb(100,100,100); background-color: rgb(230,230,230); width: 350px; height: 200px; top: 0; left: 0 } </style> </head> <!-- include jQuery library --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <!-- include Cycle plugin --> <script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#myslides').cycle({ fx: 'fade', speed: 5000, timeout: 2000 }); }); </script> <script type="text/javascript"> var curimg=0; function rotateimages(){ galleryarray.sort(); document.getElementById("myslides").setAttribute("src", "images/"+galleryarray[curimg]); curimg = (curimg+1) % galleryarray.length; } $('#myslides').ready(function() { $('#myslides').fadeOut('slow', function() { // Animation complete. }); }); window.onload = function(){ setInterval("rotateimages()", 5000); } </script> <script type="text/javascript" language="JavaScript" src="./code.php"></script> <body> <img id="myslides" src="100.jpg"> <?php echo $files ?> <!-- <div id="myslides"> --> <!--<img src="100.jpg" /> <img src="101.jpg" /> --> </body> </html> Please tell me how to fix it. How do I use array.push to add an object with a custom index in an array? I have this script but it doesnt work. Chrome's Javascript console is not outputting errors Code: var tempList = new Array(); $('#add').click(function(){ var split = $('#itemid').val().split('_'); var itemid = split['0']; var lbs = $('#lbs').val(); tempList.push(tempList['itemid'] = lbs); for (var i=0; i<=(tempList.length - 1); i++){ if (i==0){ var list = tempList[i]+ '<br />'; } else{ var list = list + tempList[i]+ '<br />'; } } alert(list); }); Hey guys. This is vague because I dont know what exactly to tell you but please reply with me so I can fix this. I want to add something to my forum. Specifically, I want to add a HTML and Picture button for when you go to reply. Like posting an article here, there are also these options (font, alignment, insert image) I do not know how to achieve this but shouldnt be too hard. Here are the two sources you will need to look through to help me fix the forum. http://neoweather.com/FWFORUM.JS http://static.websimages.com/JS/fw.js THANKS Hey guys. I want to add something to my forum. Specifically, I want to add a HTML and Picture button for when you go to reply. Like posting an article here, there are also these options (font, alignment, insert image) I do not know how to achieve this but shouldnt be too hard. Here are the two sources you will need to look through to help me fix the forum. http://neoweather.com/FWFORUM.JS http://static.websimages.com/JS/fw.js THANKS i'm still a relative noob and this has me stuck - i have a save button with a "save as copy" in the save dropdown list. add new item directs to a premade/formatted project that is used as a template, so on that item i only want/need the "save as copy" but on all other items that use the form i need to only have the "save" function. is there any way to either change the function of the button depending on item that is being viewed in the edit screen OR hide the "save" button and only show the button associated with "save as copy - and vis versa for the rest of the items?? current button code is - protected function getToolbar() { $options = array(); $user = JFactory::getUser(); $create_ms = $user->authorise('core.create', 'com_pfmilestones'); $create_task = $user->authorise('core.create', 'com_pftasks'); $options[] = array( 'text' => 'JSAVE', 'task' => $this->getName() . '.save'); $options[] = array( 'text' => 'Save as new project', 'task' => $this->getName() . '.save2copy', 'options' => array('access' => ($this->item->id > 0))); PFToolbar::dropdownButton($options, array('icon' => 'icon-white icon-ok')); item used as template is id=8 any help or suggestions would be greatly appreciated.. Hi, I am not entirely sure what I am doing wrong here, and I have been looking at this for ages, so apologies in advance if I have become so bleary eyed I can't see something simple. I use php to create buttons based on values pulled for a table. The problem I have is when you click on the first button the javascript function works great, when you click on the next button you get the same output even though it should be different results. I am working in ff and I can see on my firebug console that the javascript function is being called, but it is not passing the new value of the second or third button, it just keeps repassing the value of the first button. So not entirely sure where I am going wrong here. My page is: Code: <script type="text/javascript"> function loadXMLDoc2(File,ID,Msg){ if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { try{ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(ID).innerHTML=xmlhttp.responseText; } } var params=Msg; xmlhttp.open("POST",File,true); xmlhttp.setRequestHeader("Pragma", "Cache-Control:no-cache"); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", params.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.send(params); } </script> <head> <body> <?php $con = mysql_connect("localhost","user","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("mydb", $con); $result = mysql_query("SELECT DISTINCT theme FROM goods WHERE category='{$_POST['category']}' ORDER BY theme DESC"); while($row = mysql_fetch_array($result)){ echo '<input type="text" class="hidden" name="theme" id="theme" value="' . $row['theme'] . '" ><input type="button" class="button3" name="product" id="product" value="' . $row['product'] . '" onClick="loadXMLDoc2(\'getShow.php\',\'txtHint\',\'theme=\'+encodeURI(document.getElementById(\'rtheme\').value))" > '; } echo '<br /><br /> <div id="txtHint"><div> <br /> <br />'; mysql_close($con); ?> And getShow.php produces a table with a list of product images, names and prices, based on theme. So basically not sure where I am going wrong here? i got javascripts button : Code: <input type="button" value="select" onClick="document.getElementById('input').select()" /> how can i transform "button" to image button (gif) I have 4 rows in a table. Each row consist of 4 radio buttons. Each radio button per row has different values in it but has the same name (group) ex: <input type="radio" name="a" value="1"> <input type="radio" name="a" value="2"> <input type="radio" name="a" value="3"> <input type="radio" name="a" value="4"> <input type="radio" name="b" value="1"> <input type="radio" name="b" value="2"> <input type="radio" name="b" value="3"> <input type="radio" name="b" value="4"> and so on.. If I click radio button A with value 2, I want to output the total at the bottom as "2".. Also, if I click radio button B with value 3, I want to output the total of A and B as 5 and so on.. How can I automatically calculate the answer based on which radio button was click? update: I got my answer from this site: http://stackoverflow.com/questions/1...s-using-jquery i am trying to make a button which is a .gif that will change when a mouse over occurs and a animation will occur when click then will relocate to a new page but i am getting multiple images at the same time pleas help. Code: <html> <body> <img src="Jepordy/Fla files/Button set 1.gif" > <img name="jsbutton" src="Jepordy/Fla files/Button set 1.gif" width="550" height="400" border="0" alt="javascript button"> <SCRIPT language="JavaScript"> var myimgobj = document.images["jsbutton"]; </SCRIPT> <A href="#" onMouseOver="return changeImage()" ><img name="jsbutton" src="Jepordy/Fla files/Button mouse over.gif" width="550" height="400" border="0" alt="javascript button"></A> <SCRIPT language="JavaScript"> function changeImage() { document.images["jsbutton"].src= "C:\Documents and Settings\fus10n\Desktop\Jepordy\Fla files\Button mouse over.gif"; return true; } </SCRIPT> <A href="#" onMouseOver="return changeImage()" onMouseOutwidth="550" height="400" border="0" alt="javascript button"= "return changeImageBack()" onMouseDown="return handleMDown()" onMouseUp="return handleMUp()" ><img name="jsbutton" src="Jepordy/Fla files/Button set 1.gif" width="550" height="400" border="0" alt="javascript button"></A> <SCRIPT language="JavaScript"> function changeImage() { document.images["jsbutton"].src= "C:\Documents and Settings\fus10n\Desktop\Jepordy\Fla files\Button set 1.gif"; return true; } function changeImageBack() { document.images["jsbutton"].src = "C:\Documents and Settings\fus10n\Desktop\Jepordy\Fla files\Button set 1.gif"; return true; } function handleMDown() { document.images["jsbutton"].src = "C:\Documents and Settings\fus10n\Desktop\Jepordy\Fla files\Button set 1.gif"; return true; } function handleMUp() { changeImage(); return true; } </SCRIPT> <A href="QUESTION LOCATION FOR THIS BUTTON GOES HERE!" onMouseOver="return changeImage()" onMouseOut= "return changeImageBack()" onMouseDown="return handleMDown()" onMouseUp="return handleMUp()"> <A href="http://www.javascript-coder.com/" onMouseOver="return changeImage()" onMouseOut= "return changeImageBack()" onMouseDown="return handleMDown()" onMouseUp="return handleMUp()" ><img name="jsbutton" src="Jepordy/Fla files/Button mouse over.gif" width="550" height="400" border="0" alt="javascript button"></A> </body> </html> I have this line of code: <input type='text' id='fCode' style="width:875px; height:22px;"/><br /><br /> Does anyone know how to add a copy button to so when you click it it copies everything in the box to your clipboard? Thanks -Wardman Hi, i have the next code: PHP Code: Code: <span id="review-buttons-container" class="a-center"> <input type="image" src="<?php echo $this->getSkinUrl('images/btn_place_order.gif') ?>" onclick="review.save();" value="<?php echo $this->__('Place Order') ?>" /> </span> </p> </div> <script type="text/javascript"> //<![CDATA[ var review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder') ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements')); //]]> </script> and i add the follow JavaScript code to create checkbox (the idea is that only when you with the checkbox checked, the button work) i try: PHP Code: Code: <span id="review-buttons-container" class="a-center"> <form action="" onSubmit="return check(this);"> <input name="chkbox" value="please make sure i'm checked" type="checkbox" /> <input type="image" src="<?php echo $this->getSkinUrl('images/btn_place_order.gif') ?>" onclick="review.save();" value="<?php echo $this->__('Place Order') ?>" /> </form> </span> </p> </div> <script type="text/javascript"> //<![CDATA[ function check(form){ if( form.chkbox.checked ) return true; else{ alert("please check the checkbox"); return false; } } var review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder') ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements')); //]]> </script> but its not work for me my javascript knowledge is not so good, please help me to create this checkbox) Thanks. I'm tryingto make a button where, when you click the button, a variable will increase and refresh (reload the number displayed, but one number higher. Here is what I have: Code: <html> <head> </head> <body> <script type="text/javascript"> x=1 document.write(x) </script> <input type="button" value="Up" onclick="document.write (++ x) "> <input type="button" value="Down" onclick="document.write (-- x)"> <input type="button" value="Reload" onclick="history.go(0)"> </body> </html> The problem with this is: When you hit the "up" button, everything on the page dissapears and it just outputs "2". All the buttons and stuff dissapear? There must be a better way to do it. And would I need to use a database. Any help? Hello. I have created a Bold button - when i click the button it applies it into my textarea. The Problem is if i want to apply the bold style only to a single line and the rest of the written text will be normal and not bold it doesn't work. How can I add to the function that when i select a certain line and click on the button to make it bold only the selected line will be bold?? This is the script : PHP Code: <script type="text/javascript"> function bold(id) { var element = document.getElementById(id); element.style.fontWeight = ( element.style.fontWeight == "bold" ) ? "normal" : "bold"; } </script> And this is the button : PHP Code: <img src="Bold.bmp"width="42" height="39" title="Bold Font" onclick="bold('bodytext')" style="cursor:pointer;" /> Hey all im getting used to using .js still and I am trying to figure out how to create a button to move a selected field within a box of fields to the top, instead of just moving it one-by-one to the top. Here is what I currently have that moves the selected just up one. Can someone expand on this and make it so it will move to the top instead of just one? SearchFieldsWindow.prototype.cmdMoveUp_OnClick = function() { var searchFields = this.__searchFields; var items = this.__lstSelected.get_Items(); var selectedIndices = this.__lstSelected.get_SelectedIndices(); var count = selectedIndices.get_Count(); for (var i = 0; i < count; i++) { var selectedIndex = selectedIndices.get_Item(i); // Don't allow when first item selected if (selectedIndex == 0) break; var uniqueID = items.get_ItemValue(selectedIndex); var label = items.get_ItemLabel(selectedIndex); searchFields.MoveUp(uniqueID); items.RemoveAt(selectedIndex); items.Insert(selectedIndex - 1, uniqueID, label); this.__lstSelected.SetSelected(selectedIndex - 1, true); this.__lstSelected.SetSelected(selectedIndex, false); } }; Hey I'm looking to create a button like Facebook has that just says Like. Since I have little JavaScript experience I was wondering if anyone could point me towards a tutorial or code me one. I could do it with just a link and PHP but I want to use Ajax. http://venturebeat.com/wp-content/up...ike1020909.png I'm really not that familiar with javascript. I work with an application that provides a very basic web page for the user to view customer info....on this page is a button that will open launch a URL that allows the assoc to view a survey the customer has filled out....the customer info is in a SQL db and the web page is populated from the db table. In the data we get a doc ID for the survey and in a javascript function we have the begining of the URL to the survey. When the button is clicked it completes the URL by pulling the doc ID from the db....that is basically the current process. We are now adding additional surveys to the db and will have different URLs...we would like to use the same process but I've not been able to get it to work. Can someone let me know if there is a way to make this work? Or if you have any other questions. Thanks Travis I've never had this problem in the past and I am now stumped. I've written a fairly long script to calculate numbers for a web based Diabetes calculator but for some reason the "Calculate" button does nothing when using Chrome, Opera or Safari for iOS. It does work when using IE, Firefox and Safari for PC. I've looked everywhere and found nothing but some references to an 'onclick' problem in Chrome. My problem is that the same method has always worked in the past and is still working in those scripts now so that can't be the issue. What is different about THIS button that is breaking it? Button WORKS here (IE, Chrome, Firefox, Safari-PC & iOS & Opera): http://jdrinc.webatu.com/FICC.html But DOES NOT work here (Chrome, Safari-iOS & Opera): http://jdrinc.webatu.com/D-Calc.html The second link DOES work in IE, Firefox & Safari-PC. I don't see a difference in the method that I'm using in either of these. Does anyone know what I am doing wrong? Here is the html with the script that is NOT working: Code: <html> <head> <title> D-Calc </title> <style type="text/css"> table { border:2px solid black; border-collapse:collapse; } th { border:2px solid black; border-collapse:collapse; font-family: Arial, Helvetica, sans-serif; text-align: left; font-weight: bold; } td { border:2px solid black; border-collapse:collapse; font-family: Arial, Helvetica, sans-serif; text-align: left; font-weight: bold; } .inputlabel { background-color: #6CC417; } .outputlabel { background-color: #6698FF; } .inputbox { border:0px inset blue; background-color: #FFFFFF; border-color: #FFFFFF; text-align: center; font-weight: bold; width: 100px; } .outputbox { border:0px inset blue; background-color: #FFFFFF; border-color: #FFFFFF; text-align: center; font-weight: bold; width: 100px; } </style> <script type="text/javascript"> function Calculate() { //input variables var B01, B02, B03, B04, B05, B06, B07, B08, B09, B10, B11 //output variables var B12, B13, B14, B15, B16, B17, B18, B19, B20, B21, B22, B23, B24, B25, B26 //correction sensitivity variable var CSV //new blood glucose var NBG //bloodsugar-carbohydrate ratio var BCR B01=eval(document.DCalcForm.B01.value); B02=eval(document.DCalcForm.B02.value); BCR=(B02/B01); B03=eval(document.DCalcForm.B03.value); B04=eval(document.DCalcForm.B04.value); B05=eval(document.DCalcForm.B05.value); B06=eval(document.DCalcForm.B06.value); B07=eval(document.DCalcForm.B07.value); B08=eval(document.DCalcForm.B08.value); B09=eval(document.DCalcForm.B09.value); B10=eval(document.DCalcForm.B10.value); B11=eval(document.DCalcForm.B11.value); B12=(B10*(B03/100)); B13=(B11*(B04/100)); B14=(B09+B12+B13); B15=(B09); B16=(B12+B13); if (B07<(B05+(B06+1)) && B07>(B05-(B06+1))) { CSV=(0); } else if (B07>(B05+B06)) { CSV=(B06); } else if (B07<(B05-B06)) { CSV=(-1*B06); } if (CSV==0) { B17=0; } else { B17=((B07-(B05+CSV))/B02); } B18=((B12*(B03/100))/B01); B19=((B13*(B04/100))/B01); B20=(B09/B01); if (CSV=0) { B21=((B18+B19+B20)-B08); } else { B21=((B17+B18+B19+B20)-B08); } B22=((B17+B20)-B08); B23=(B18+B19); if (B21==0) { B24=0; } else { B24=((B22/B21)*100); } if (B21==0) { B25=0; } else { B25=((B23/B21)*100); } NBG=(B07+((B09+B12+B13)*BCR)); if (B07<(B05+(B06+1)) && B07>(B05-(B06+1))) { CSV=(0); } else if (B07>(B05+B06)) { CSV=(B06); } else if (B07<(B05-B06)) { CSV=(-1*B06); } if (CSV==0) { B26=0; } else { B26=(((B05+CSV)-NBG)/BCR); } document.DCalcForm.B12.value=(Math.round(B12*100))/100 + ' g'; document.DCalcForm.B13.value=(Math.round(B13*100))/100 + ' g'; document.DCalcForm.B14.value=(Math.round(B14*100))/100 + ' g'; document.DCalcForm.B15.value=(Math.round(B15*100))/100 + ' g'; document.DCalcForm.B16.value=(Math.round(B16*100))/100 + ' g'; if (B17<0) { document.DCalcForm.B17.value='0 unit(s)'; } else { document.DCalcForm.B17.value=(Math.round(B17*100))/100 + ' unit(s)'; } if (B18<0) { document.DCalcForm.B18.value='0 unit(s)'; } else { document.DCalcForm.B18.value=(Math.round(B18*100))/100 + ' unit(s)'; } if (B19<0) { document.DCalcForm.B19.value='0 unit(s)'; } else { document.DCalcForm.B19.value=(Math.round(B19*100))/100 + ' unit(s)'; } if (B20<0) { document.DCalcForm.B20.value='0 unit(s)'; } else { document.DCalcForm.B20.value=(Math.round(B20*100))/100 + ' unit(s)'; } if (B21<0) { document.DCalcForm.B21.value='0 unit(s)'; } else { document.DCalcForm.B21.value=(Math.round(B21*100))/100 + ' unit(s)'; } if (B22<0) { document.DCalcForm.B22.value='0 unit(s)'; } else { document.DCalcForm.B22.value=(Math.round(B22*100))/100 + ' unit(s)'; } if (B23<0) { document.DCalcForm.B23.value='0 unit(s)'; } else { document.DCalcForm.B23.value=(Math.round(B23*100))/100 + ' unit(s)'; } if (B24>100) { document.DCalcForm.B24.value='100 %'; } else if (B24<0) { document.DCalcForm.B24.value='0 %'; } else { document.DCalcForm.B24.value=(Math.round(B24*100))/100 + ' %'; } if (B25>100) { document.DCalcForm.B25.value='100 %'; } else if (B25<0) { document.DCalcForm.B25.value='0 %'; } else { document.DCalcForm.B25.value=(Math.round(B25*100))/100 + ' %'; } if (B26<0) { document.DCalcForm.B26.value='0.00 g'; } else { document.DCalcForm.B26.value=(Math.round(B26*100))/100 + ' g'; } // document.write('B01 = '+B01+'<br>'); // document.write('B02 = '+B02+'<br>'); // document.write('B03 = '+B03+'<br>'); // document.write('B04 = '+B04+'<br>'); // document.write('B05 = '+B05+'<br>'); // document.write('B06 = '+B06+'<br>'); // document.write('B07 = '+B07+'<br>'); // document.write('B08 = '+B08+'<br>'); // document.write('B09 = '+B09+'<br>'); // document.write('B10 = '+B10+'<br>'); // document.write('B11 = '+B11+'<br>'); // document.write('B12 = '+B12+'<br>'); // document.write('B13 = '+B13+'<br>'); // document.write('B14 = '+B14+'<br>'); // document.write('B15 = '+B15+'<br>'); // document.write('B16 = '+B16+'<br>'); // document.write('B17 = '+B17+'<br>'); // document.write('B18 = '+B18+'<br>'); // document.write('B19 = '+B19+'<br>'); // document.write('B20 = '+B20+'<br>'); // document.write('B21 = '+B21+'<br>'); // document.write('B22 = '+B22+'<br>'); // document.write('B23 = '+B23+'<br>'); // document.write('B24 = '+B24+'<br>'); // document.write('B25 = '+B25+'<br>'); // document.write('B26 = '+B26+'<br>'); // document.write('BCR = '+BCR+'<br>'); // document.write('CSV = '+CSV+'<br>'); // document.write('NBG = '+NBG+'<br>'); } </script> </head> <body> <center> <form name=DCalcForm> <table name="table" id="table" class="table"> <tr name="01" id="01" class=""> <td name="A01" id="A01" class="inputlabel"> INSULIN/CARBOHYDRATE RATIO </td> <td name="B01" id="B01" class=""> <input name="B01" id="B01" class="inputbox" value="10" type="number"> </td> <td name="C01" id="C01" class=""> </td> </tr> <tr name="02" id="02" class=""> <td name="A02" id="A02" class="inputlabel"> INSULIN/BG RATIO </td> <td name="B02" id="B02" class=""> <input name="B02" id="B02" class="inputbox" value="35" type="number"> </td> <td name="C02" id="C02" class=""> </td> </tr> <tr name="03" id="03" class=""> <td name="A03" id="A03" class="inputlabel"> PROTEIN RATIO </td> <td name="B03" id="B03" class=""> <input name="B03" id="B03" class="inputbox" value="40" type="number"> </td> <td name="C03" id="C03" class=""> </td> </tr> <tr name="04" id="04" class=""> <td name="A04" id="A04" class="inputlabel"> FAT RATIO </td> <td name="B04" id="B04" class=""> <input name="B04" id="B04" class="inputbox" value="10" type="number"> </td> <td name="C04" id="C04" class=""> </td> </tr> <tr name="05" id="05" class=""> <td name="A05" id="A05" class="inputlabel"> TARGET BLOOD GLUCOSE </td> <td name="B05" id="B05" class=""> <input name="B05" id="B05" class="inputbox" value="100" type="number"> </td> <td name="C05" id="C05" class=""> </td> </tr> <tr name="06" id="06" class=""> <td name="A06" id="A06" class="inputlabel"> CORRECTION RANGE/SENSITIVETY </td> <td name="B06" id="B06" class=""> <input name="B06" id="B06" class="inputbox" value="20" type="number"> </td> <td name="C06" id="C06" class=""> </td> </tr> <tr name="07" id="07" class=""> <td name="A07" id="A07" class="inputlabel"> CURRENT BLOOD GLUCOSE </td> <td name="B07" id="B07" class=""> <input name="B07" id="B07" class="inputbox" value="100" type="number"> </td> <td name="C07" id="C07" class=""> </td> </tr> <tr name="08" id="08" class=""> <td name="A08" id="A08" class="inputlabel"> INSULIN ON BOARD </td> <td name="B08" id="B08" class=""> <input name="B08" id="B08" class="inputbox" value="0" type="number"> </td> <td name="C08" id="C08" class=""> </td> </tr> <tr name="09" id="09" class=""> <td name="A09" id="A09" class="inputlabel"> CARBOHYDRATES </td> <td name="B09" id="B09" class=""> <input name="B09" id="B09" class="inputbox" value="0" type="number"> </td> <td name="C09" id="C09" class=""> </td> </tr> <tr name="10" id="10" class=""> <td name="A10" id="A10" class="inputlabel"> PROTEIN </td> <td name="B10" id="B10" class=""> <input name="B10" id="B10" class="inputbox" value="0" type="number"> </td> <td name="C10" id="C10" class=""> </td> </tr> <tr name="11" id="11" class=""> <td name="A11" id="A11" class="inputlabel"> FAT </td> <td name="B11" id="B11" class=""> <input name="B11" id="B11" class="inputbox" value="0" type="number"> </td> <td name="C11" id="C11" class=""> </td> </tr> <tr name="12" id="12" class=""> <td name="A12" id="A12" class="outputlabel"> CARBS FROM PROTEIN </td> <td name="B12" id="B12" class=""> <input name="B12" id="B12" class="outputbox" value="" type="number" readonly> </td> <td name="C12" id="C12" class=""> </td> </tr> <tr name="13" id="13" class=""> <td name="A13" id="A13" class="outputlabel"> CARBS FROM FAT </td> <td name="B13" id="B13" class=""> <input name="B13" id="B13" class="outputbox" value="" type="number" readonly> </td> <td name="C13" id="C13" class=""> </td> </tr> <tr name="14" id="14" class=""> <td name="A14" id="A14" class="outputlabel"> TOTAL CARBOHYDRATES </td> <td name="B14" id="B14" class=""> <input name="B14" id="B14" class="outputbox" value="" type="number" readonly> </td> <td name="C14" id="C14" class=""> </td> </tr> <tr name="15" id="15" class=""> <td name="A15" id="A15" class="outputlabel"> CARBS TO BOLUS NOW </td> <td name="B15" id="B15" class=""> <input name="B15" id="B15" class="outputbox" value="" type="number" readonly> </td> <td name="C15" id="C15" class=""> </td> </tr> <tr name="16" id="16" class=""> <td name="A16" id="A16" class="outputlabel"> CARBS FOR EXTENDED BOLUS </td> <td name="B16" id="B16" class=""> <input name="B16" id="B16" class="outputbox" value="" type="number" readonly> </td> <td name="C16" id="C16" class=""> </td> </tr> <tr name="17" id="17" class=""> <td name="A17" id="A17" class="outputlabel"> CORRECTION BOLUS </td> <td name="B17" id="B17" class=""> <input name="B17" id="B17" class="outputbox" value="" type="number" readonly> </td> <td name="C17" id="C17" class=""> </td> </tr> <tr name="18" id="18" class=""> <td name="A18" id="A18" class="outputlabel"> PROTEIN BOLUS </td> <td name="B18" id="B18" class=""> <input name="B18" id="B18" class="outputbox" value="" type="number" readonly> </td> <td name="C18" id="C18" class=""> </td> </tr> <tr name="19" id="19" class=""> <td name="A19" id="A19" class="outputlabel"> FAT BOLUS </td> <td name="B19" id="B19" class=""> <input name="B19" id="B19" class="outputbox" value="" type="number" readonly> </td> <td name="C19" id="C19" class=""> </td> </tr> <tr name="20" id="20" class=""> <td name="A20" id="A20" class="outputlabel"> CARB BOLUS </td> <td name="B20" id="B20" class=""> <input name="B20" id="B20" class="outputbox" value="" type="number" readonly> </td> <td name="C20" id="C20" class=""> </td> </tr> <tr name="21" id="21" class=""> <td name="A21" id="A21" class="outputlabel"> TOTAL BOLUS </td> <td name="B21" id="B21" class=""> <input name="B21" id="B21" class="outputbox" value="" type="number" readonly> </td> <td name="C21" id="C21" class=""> </td> </tr> <tr name="22" id="22" class=""> <td name="A22" id="A22" class="outputlabel"> UNITS TO DELIVER NOW </td> <td name="B22" id="B22" class=""> <input name="B22" id="B22" class="outputbox" value="" type="number" readonly> </td> <td name="C22" id="C22" class=""> </td> </tr> <tr name="23" id="23" class=""> <td name="A23" id="A23" class="outputlabel"> UNITS TO EXTEND </td> <td name="B23" id="B23" class=""> <input name="B23" id="B23" class="outputbox" value="" type="number" readonly> </td> <td name="C23" id="C23" class=""> </td> </tr> <tr name="24" id="24" class=""> <td name="A24" id="A24" class="outputlabel"> PERCENT TO DELIVER NOW </td> <td name="B24" id="B24" class=""> <input name="B24" id="B24" class="outputbox" value="" type="number" readonly> </td> <td name="C24" id="C24" class=""> </td> </tr> <tr name="25" id="25" class=""> <td name="A25" id="A25" class="outputlabel"> PERCENT TO EXTEND </td> <td name="B25" id="B25" class=""> <input name="B25" id="B25" class="outputbox" value="" type="number" readonly> </td> <td name="C25" id="C25" class=""> </td> </tr> <tr name="26" id="26" class=""> <td name="A26" id="A26" class="outputlabel"> MORE CARBS NEEDED </td> <td name="B26" id="B26" class=""> <input name="B26" id="B26" class="outputbox" value="" type="number" readonly> </td> <td name="C26" id="C26" class=""> </td> </tr> </table> <br> <input type="button" value="Calculate" name="CalculateButton" onclick="Calculate()"> </form> </body> </html> P.S. I am by no means a professional and am aware that there might be better ways of doing this. I am still learning. can anyone give me a sample code for this situation ? - button A = labeled as Unlocked - when I on mouse over button A the label should turn into "Lock me ?" - and then when I click the button, the label will change to "Locked" |