JavaScript - Adding Variables
Hi there,
Greetings, I have limited knowledge on Javascript. I wish someone could help me out. Thanks. I have actually found a free script named "Image Flow" (http://finnrudolph.de/ImageFlow/Examples) on the website. Then, I have uploaded it to my web server. Everything was fine and functioning well. I would like to add in new Var (to make new window appears after clicking) according to the codes given but failed to do so. The codes given are A) Code: var target_1 = new ImageFlow(); target_1.init({ ImageFlowID: 'target_1,' onClick: function() {window.open(this.url, '_blank');} }); Then, I just added the above code into imageflow.JS and imageflow.packed.JS. (I have attached the file below) Original: Code: domReady(function() { var instanceOne = new ImageFlow(); instanceOne.init({ ImageFlowID:'myImageFlow' }); }); After amendment: Code: domReady(function() { var instanceOne = new ImageFlow(); instanceOne.init({ ImageFlowID:'myImageFlow' }); var target_1 = new ImageFlow(); target_1.init({ ImageFlowID: 'target_1,' onClick: function() {window.open(this.url, '_blank');} }); }); However, no pictures were loaded after that. Does it involve more than just "copy and paste"? Or what have I done incorrectly? Sorry to disturb you. Similar TutorialsHi everyone, I am working on an assignment and require a little bit of assistance. I have a form (an order form) where I am required to validate the required entries - I have managed to do this with the textbox field no problems. Where I am coming unstuck is with the following items. homePhone - numbers only and max 10 numbers for validation postCode - same as above email validation of @ and . How do I validate comboboxs so that if nothing is selected an alert shows? If the "other address" radiobutton is checked how do I have the text boxes only validate on check? How do I validate the textarea when "do you want a card message" is ticked? I have been working on this for the past week and a bit and have done a fair amount of research and tried to implement various pieces of code I have found with no luck. I have removed some of the select objects to cut down on the amount of code. I am not expecting anyone to write my assignment for me, just wanting assistance to help me learn and become more proficient in JS Regards BP Code: <html> <head> <title>Online Order Form</title> <meta http-equiv="Content-type" content="text/html; charset=UTF-8"> <meta name="author" content="Jeremy Porteous"> <script type="text/javascript"> <!-- function validate(){ var form=document.getElementById("orderForm"); var Name=form["fullName"].value; var fullName_err=document.getElementById("fullName_err"); var address=form["address"].value; var address_err=document.getElementById("address_err"); var location=form["location"].value; var location_err=document.getElementById("location_err"); var postcode=form["postcode"].value; var postcode_err=document.getElementById("postcode_err"); var homePhone=form["homePhone"].value; var homephone_err=document.getElementById("homePhone_err"); var email=form["email"].value; var email_err=document.getElementById("email_err"); var checkbox=form["card"].value; var street=form["street"].value; var street_err=document.getElementById("street_err"); var otherLocation=form["otherLocation"].value; var otherLocation_err=document.getElementById("otherLocation_err"); var otherPostcode=form["otherPostcode"].value; var otherPostcode_err=document.getElementById("otherPostcode_err"); if(Name==""){ fullName_err.innerHTML="Please enter your Full Name"; }else{ fullName_err.innerHTML=""; } if(address==""){ address_err.innerHTML="Please enter your Street Address"; }else{ address_err.innerHTML=""; } if(location==""){ location_err.innerHTML="Please enter your Surburb/Town"; }else{ location_err.innerHTML=""; } if(postcode==""){ postcode_err.innerHTML="Please enter your Postcode"; }else{ postcode_err.innerHTML=""; } if(homePhone==""){ homePhone_err.innerHTML="Please enter your Phone Number"; }else{ homePhone_err.innerHTML=""; } if(email==""){ email_err.innerHTML="Please enter a valid Email"; }else{ email_err.innerHTML=""; } if(street==""){ street_err.innerHTML="Please enter Street Address"; }else{ street_err.innerHTML=""; } if(otherLocation==""){ otherLocation_err.innerHTML="Please enter Suburb/Town"; }else{ otherLocation_err.innterHTML=""; } if(otherPostcode==""){ otherPostcode_err.innerHTML="Please enter Postcode"; }else{ otherPostcode_err.innerHTML=""; } if(Name=="" || address=="" || location=="" || postcode=="" || homePhone=="" || email=="" || street=="" || otherLocation=="" || otherPostcode=="") { alert("Please Check form and fill in form data correctly"); return false; }else{ return true; } } --> </script> <h2>Joes Online Order Form</h2> <h5>* denotes a required field</h5> <h3><u>Your Details</u></h3> <form id="orderForm" name="orderForm" method="post" action="" onsubmit="javascript:return validate()"> <!-- The form user is required to fill in some personal information * is a required field --> <!-- Input fields will be validated --> <h4>*Name: <label><input type="text" id="fullName" size="35"></label> <label id="fullName_err" style="color:#FF0000; font-style:italic;"></label></h4> <h4>* Address: <label><input type="text" id="address" size="30"></label> <label id="address_err" style="color:#FF0000; font-style:italic;"></label> * Suburb/Town: <label><input type="text" id="location" size="30"></label> <label id="location_err" style="color:#FF0000; font-style:italic;"></label></h4> <!-- The input field for "state" is a dropdown combo box --> <h4>* State: <select name="homeState" size="0"> <option value="State">Select your State</option> <option value="ACT">ACT</option> <option value="NSW">NSW</option> </select> <label id="homeState_err" style="color:#FF0000; font-style:italic;"></label> * Postcode: <label><input type="text" id="postcode" maxlength="4" size="4"></label> <label id="postcode_err" style="color:#FF0000; font-style:italic;"></label></h4> <h4>* Home Phone: <label><input type="text" id="homePhone" maxlength="10" size="10"></label> <label id="homePhone_err" style="color:#FF0000; font-style:italic;"></label></h4> <h5>Work Phone: <input type="text" id="workPhone" maxlength="10" size="10"> Fax: <input type="text" id="Fax" maxlength="10" size="10"></h5> <h4>* Email: <label><input type="text" id="email" size="30"></label> <label id="email_err" style="color:#FF0000; font-style:italic;"></label></h4> <!-- The input fields for "type" and "expDate" are dropdown combo boxes --> <h4><em>Credit Card Details</em></h4> <h4>* Type: <select name="creditCard" size="0"> <option value="creditCard">Select your Credit Card</option> <option value="visa">Visa</option> <option value="mastercard">Master Card</option> </select> * Exp Date: <select name="expMonth" size="0"> <option value="Jan">Jan</option> <option value="Feb">Feb</option> <option value="Mar">Mar</option> </select> <select name="expYear" size="0"> <option value="2012">2012</option> <option value="2013">2013</option> <option value="2014">2014</option> </select></h4> <!-- Using the combo boxes the user can select type of basket and qty --> <h4><em>Purchase Details</em></h4> <h4>* Basket Type: <select name="basketType" size="0"> <option value="Select a Basket">Select a Basket</option> <option value="1A">1A</option> <option value="1B">1B</option> </select> * Qty: <select name="quantity" size="0"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select></h4> <h4><b>* Deliver To:</b></h4> <!-- Radio buttons are mutually exclusive --> <h4><input type="radio" id="homeDel" name="delAddress" value="homeAddress" checked> Home Address</h4> <h4><input type="radio" id="otherDel" name="delAddress" value="otherAddress"> Other Address</h4> <!-- the following is for the "Other Address option" --> <h3><u>Other Address Details</u></h3> <h4>* Street: <label><input type="text" id="street" size="30"></label> <label id="street_err" style="color:#FF0000; font-style:italic;"></label> <!-- The input field for "state" is a dropdown combo box --> * Suburb/Town: <label><input type="text" id="otherLocation" size="30" ></label> <label id="otherLocation_err" style="color:#FF0000; font-style:italic;"></label></h4> <h4>* State: <select name="state" size="0"> <option value="State">Select the State</option> <option value="ACT">ACT</option> <option value="NSW">NSW</option> </select> * Postcode: <input type="text" id="otherPostcode" maxlength="4" size="4"> <label id="otherPostcode_err" style="color:#FF0000; font-style:italic;"></label></h4> <h4><em><b>* Date Delivery Required</b></em> <select name="delDay" size="0"> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> </select> <select name="delMonth" size="0"> <option value="Jan">Jan</option> <option value="Feb">Feb</option> <option value="Mar">Mar</option> <option value="Apr">Apr</option> </select> <select name="delYear" size="0"> <option value="2012">2012</option> </select></h4> <h5>Would you like to include a card? <input type="checkbox" id="card"> <label id="card_err" style="color:#FF0000; font-style:italic;"></label></h5> <!-- Text box message will only be submitted if checkbox is ticked --> <p>Leave a personal message for the card<br> <textarea name="text" id="cardMessage" rows="5" cols="28"> Enter your message here</textarea></p> <p>***Click on <b>Submit</b> when complete or <b>Clear Form</b> to reset form***</p> <input type="submit" id="submit" value="Submit"> <input type="reset" value="Clear Form" onClick="reset"> </form> </body> </html> Hi, firstly I apologise if the title of this thread isn't quite accurate. I'm sure you've all heard it before but I am a complete newbie to Javascript so again: apologies if this is boring and tiresome to even read, let alone help with! I have been asked to make some changes to a form that uses Javascript for the form validation. There is a 'function' that contains the variables of the various form fields and then further code to raise 'alerts' if one of the fields on the form hasn't been filled in. My problem is that for some reason I am unable to add an extra variable to this code after the field of 'County' (this will hopefully make sense when you see the code / link...) and I am stumped as to why. I am able to add variables for all of the other required fields except for 'Postcode' after 'County'. This is the case for both forms. The link is he http://samdelara.co.uk/previews/banq...ation-form.htm and the code I am trying edit is below: function checkAvailibility() { // re-calculate... calculate (); if ( isName() && isAddress1() && isTown() && isCounty() && isPostcode() && isYourEmail() && isFuncDate() && somethingToQuoteFor() && isYourEmailValid() ) { document.ordersummary.emailQuote.value = "No"; setValue(); return true; } else { return false; } } function isName() { if (document.ordersummary.Name.value=="") { alert ("\n Please Enter Your Name") document.ordersummary.Name.focus(); return false; } return true; } function isAddress1() { if (document.ordersummary.Address1.value=="") { alert ("\n Please Enter Your Address") document.ordersummary.Address1.focus(); return false; } return true; } function isTown() { if (document.ordersummary.Town.value=="") { alert ("\n Please Enter Your Town") document.ordersummary.Town.focus(); return false; } return true; } function isCounty() { if (document.ordersummary.County.value=="") { alert ("\n Please Enter Your County") document.ordersummary.County.focus(); return false; } return true; } function isPostcode() { if (document.ordersummary.Postcode.value=="") { alert ("\n Please Enter Your Postcode") document.ordersummary.Postcode.focus(); return false; } return true; } function isYourEmail() { if (document.ordersummary.YourEmail.value=="") { alert ("\n Please Enter Your Email") document.ordersummary.YourEmail.focus(); return false; } return true; } function isFuncDate() { if (document.ordersummary.FuncDate.value=="") { alert ("\n Please Enter Your Function Date") document.ordersummary.FuncDate.focus(); return false; } return true; } function isemailonly() { if (document.ordersummary.emailonly.value=="") { alert ("\n Please Enter Your Email Address") document.ordersummary.emailonly.focus(); return false; } return true; } Any help with this would be very much appreciated and once again, I apologise for my distinct lack of knowledge in this area! Sam I wrote a script: when the same button is clicked for the first time, it should give a message "Hello World", for the second time "hello Earth". The script is not working. I don't want anybody to re-write the script, but to look at how i define variables and tell me where I am wrong. I think, this is where the main error is. my current script just outputs the message "hello world". my assumption is that functions can alter the value of a global variable. Thank you very much. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> title</title> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <script type="text/javascript"> var count=0; function changePar() { if(count===0) first(); if(count===1) second(); } function first() { document.getElementById("changingParagraph").innerHTML="Hello World"; var count=1; } function second() { document.getElementById("changingParagraph").innerHTML="Hello Earth"; var count=0; } </script> </head> <body> <button onclick="changePar()">Click Here</button> <p id="changingParagraph"></p> </body> </html> I hope someone can help me! I have a website that sells a product through a third party merchant - ie a customer clicks my "buy now" button and they are transfered to the merchants payment processing page. once the transaction is complete the customer is sent back to my thank you page where I give them some extra stuff for free. All pretty normal I guess. The problem is this - The merchant sends back some url parameters when they transfer the customer to the thank you page and I would now like to use the "customer name" parameter to personalise the thank you page to test if this makes any difference to my return rate. Now, whilst I am not a complete newbie I haven't got a clue how to achieve this. What I want to do is have the page display: "Hello [customer] .....etc..." The customer name parameter is passed as "cname" and is one of about a dozen passed seperated, presumably, by "&" Thanks for any help! Paul Hi All Please could any one shed some light on the values of thirdVar fourthVar and fifthVar. Am i correct to say that value of thirdVar is o cromwell Any help and explanation would be great thanks. var firstVar = 'oliver' var secondVar = 'cromwell' var thirdVar = firstVar.charAt (0) + '. ' + secondVar var fourthVar = thirdVar.length var fifthVar = 'The last character is' + thirdVar.charAt (fourthVar) + '!' Noob here. Please bear with me.http://www.codingforums.com/images/smilies/tongue.gif <span title="this is the title">....</span> I need to use variables for the title instad of text. Please advise. Thank you. hello i am editing a javascript game and im trying to get a heading (h1) to display the value of a variable in a javascript function however everything i have tried always causes an error. Any help will be apreciated. I have this code: Code: var player = 100; var part1 = ('ctl00_cphRoblox_TabbedInfo_GamesTab_RunningGamesList_RunningGamesListView_ctrl0_ctl00_PlayersRepeater_ct'); var part2 = ('_PlayerImage1'); var final = part1 + player + part2; var name = document.getElementById(final) The variable (name) turns up null when I try to see what it is. But, it is, infact, an element on the page, and when I do it manually it works. Help? Hi, I'm looking to use the document function in javascript to change the TYPE of an INPUT. However I want to change the TYPE of the INPUT according to a variable passed to the javascript button, so i use: document.formname.inputname.value="newvalue"; I want to be able to change what inputname is depending on what is passed to the function, but right now firefox is telling me that it's undefined. Is there any way I can do this? Thanks in advance, Daniel Hello, Does anyone know how to list all declared variables in JavaScript ? tnx Hello, I am using javascript to dynamically edit a form and have run into some problems. In this excerpt of code "x" is already defined, "num" is already defined, and "eval(q)" is just pointing to the proper field in the proper form. Code: eval(q).onkeydown=function onkeydown(event) { checkLength(event,x,num,5); }; Now the problem is, it is literally calling the function with "x" and "num" instead of their values. I tried "eval(x)" and "eval(num)" but that literally calls it with that whole statement as the parameter. How can I call this with the actual values inside of x and num? Thank you. I am perplexed about this one. Not sure if php is the best solution or maybe javascript. ( or both.) I am writing a litle script that will go to my mysql table and take out 20 rows ( from about 10,000 rows ) based on the WHERE statement. Then I want to step through these 20 rows displaying just two filds in this fashion: First, I want to display one field in a "box" ( using divs and css ) then wait for a form input. Then while keeping the first displayed box and field display the second field in a similar box a fee lines below. Wait for a form input update some data. Then onto the next row. If I use javascript then I could keep all the processing on one page and not have to have server refreshes. But how do I get these those array elements from $row['field1'] and $row['field2'] into javascript vars ? Is this the best way to do this ? Or would php and having a couple of extra trips to the server for form processing be better ? Thanks for any input. . Hi, Ive got a iphone based website im writing in html/javascript, it all works perfectly well apart from an issue with a javascript variable and i cant figure out what im doing wrong At the start of the code i declare a variable var jpgname='blank'; - its blank for testing I then have a href which attempts to change this variables value when clicked <li class="flip"><a onClick="jpgname='test'" href="#page">Cars</a></li> If i replace the jpgname='test' with confirm('test) i get a popupbox so i know its running this code under my #page section (just a div named section) i have [<h1><script>document.write(jpgname);</script></h1> however this always has the value 'blank' Im sure im doing something stupid but im not sure what Any help gratefully recieved thanks Mike I have this code, (a snippet of it below) which works, but how can I simplify it instead of repeating all the same code for the 12 different checks I have to run. If whatColor == A1 I need the search variable to equal fashion If whatColor == A2 I need the search variable to equal photography etc. Thanks Code: if (whatColor == 'A1') { /* search: 'fashion', */ new TWTR.Widget({ version: 2, type: 'search', search: 'fashion', interval: 2000, title: '', subject: '', width: 310, height: 240, theme: { shell: { background: '#edecee', color: '#444444' }, tweets: { background: '#edecee', color: '#444444', links: '#e80f45' } }, features: { scrollbar: true, loop: false, live: true, hashtags: true, timestamp: true, avatars: true, behavior: 'all' } }).render().start(); } else if (whatColor == 'A2') { /* search: 'photography', */ new TWTR.Widget({ version: 2, type: 'search', search: 'photography', interval: 2000, title: '', subject: '', width: 310, height: 240, theme: { shell: { background: '#edecee', color: '#444444' }, tweets: { background: '#edecee', color: '#444444', links: '#e80f45' } }, features: { scrollbar: true, loop: false, live: true, hashtags: true, timestamp: true, avatars: true, behavior: 'all' } }).render().start(); The Code, is from a twitter widget that pulls a twitter feed based on the search variable. This is the code straight from twitter. Code: <script src="http://widgets.twimg.com/j/2/widget.js"></script> <script> new TWTR.Widget({ version: 2, type: 'search', search: 'photography', interval: 2000, title: '', subject: '', width: 310, height: 240, theme: { shell: { background: '#edecee', color: '#444444' }, tweets: { background: '#edecee', color: '#444444', links: '#e80f45' } }, features: { scrollbar: false, loop: false, live: true, hashtags: true, timestamp: true, avatars: true, behavior: 'all' } }).render().start(); </script> Hi! I am trying to use innerHTML but unsuccessfully on my Wordpress website. Please see the following code: Code: var string = "<?php the_content(); ?>"; function textchange() { document.getElementById('box_content_slideshow').innerHTML = '<div class="box_content">'+string+'</div>'; } The problem is that when wordpress puts the content in the variable 'string', it automatically adds carriage returns/line break result in: Code: var string = "<p>heading</p> <p>sample text</p> <p>more text</p>"; Is there any way I can remove the line breaks making the string like: Code: var string = "<p>heading</p><p>sample text</p><p>more text</p>"; I have tried using: Code: var string = (<r><![CDATA[ The text string goes here. Since this is a XML CDATA section, stuff like <> work fine too, even if definitely invalid XML. ]]></r>).toString(); But this only works in FF, and not in IE, Opera, or Safari. Thanks a lot! Cheers! can anyone tell me why this doesn't work please: <html> <head> </head> <body> <input type="hidden" name="ba1r1c1" value="hello"> <script language="text/javascript"> ba1r1c1.value = "goodbye"; document.write(ba1r1c1.value); </script> </body> </html> thanks Hello everyone. I am new to this forum and hope to become a good addition. Thanks in advance to whom ever might help. I am having trouble concatenating variables in the alert box. The alert will basically be: Sum of the numbers from 1 through 5 is 15. But the 5 is the var = userEntry and the 15 is the var = sumOfNumbers. Of course, the numbers 5 and 15 will be replaced by the userEntry and the calculated sumOfNumbers. I have been able to make the first variable work, but cannot get the second one. For example: alert (" Sum of the numbers from 1 through " + userEntry);. I just cannot figure out how to concatenate a second variable into the message. I hope I am making sense. I am new to javascript and working off of Murach's Javascript and jQuery. Thanks again! I am building a search function for a sermon blog on squarespace. The format url for category search is www.mysite.org/blog?category=... I have drop down menus and a datepicker but need to figure out how to get java to build the url and redirect to it. The output url should look like http://www.mysite.org/sermons?catego...+mybook+mydate. Any help would be greatly appreciated. Here is my java so far. Code: function search() { var myRootSite = 'www.mysite.org/sermons?category='; var myNewTitle = document.getElementById('myTextField').value; var mySpeaker = document.getElementById('mySpeaker').value; var myService = document.getElementById('myService').value; var mySeries = document.getElementById('mySeries').value; var myBook = document.getElementById('myBook').value; var myDate = document.getElementById('myDate').value; if (myNewTitle == 0 && mySpeaker == 0 && myService == 0 && mySeries == 0 && myBook == 0 && myDate == 0) { alert('Please enter some search criteria'); return; } var title = document.getElementById('title'); title.innerHTML = mySpeaker; } Hi, I haven't used variable variables before and I'm still trying to get my head around it. I think I'm going OK but I have run into a fairly obscure little problem that I thought I'd throw out there to see if anyone has any ideas... The plan: to make a distance calculator that measures a line made by clicking on a google map. Overall distance is shown at the side, but segment length is shown in tooltip-like labels called Elabels. Segments can get dragged and segment length is updated as dragging occurs. Being that the number of segments (and labels) depends on the number of user clicks, I thought it would be a good idea to use the variable variable to keep all the references unique. If there's a better way to do this, I'd love to hear about it. The problem: it all works fine, except that, if you consider that dragging a point on a line changes two line lengths (let's say A is the start, B is the drag point and C is the end), only one length is updating - the A to B section. What I want is for the Elabel at C to reflect the change in the B to C line length as well. Anyway. Here's the page I'm working on. The relevant code is below. I've tried duplicating it and adding +1 to the variables (and every permutation thereof) but no dice. All I need really is for exactly what's happening now to be happening in the next Elabel along in the array. Any suggestions much appreciated. Code: function leftClick(overlay, point) { count++; var mar1= count-2; var mar2= count-1; var mar3= count; var mar4= count+1; window["label" + mar2]=new ELabel(point, dist ,"labelstyle",new GSize(10,10)); labels2.push(window["label" + mar2]); map.addOverlay(window["label" + mar2]); // Drag listener GEvent.addListener(marker, "drag", function() { drawOverlay(); window["marker" + mar2]=markers[mar1]; window["marker" + mar3]=markers[mar2]; window["marker" + mar4]=markers[mar3]; line = [window["marker" + mar2].getPoint(),window["marker" + mar3].getPoint()]; dist2=window["marker" + mar2].getPoint().distanceFrom(window["marker" + mar3].getPoint()); dist2="Segment<br> length:<br>"+dist2.toFixed(0)+"m"; if(parseInt(dist2)>10000){dist2=(parseInt(dist2)/1000).toFixed(1)+"km";} window["label" + mar2].setPoint(marker.getPoint()); window["label" + mar2].setContents(dist2); } Hi, I'm trying to make a calculator app; with a few differences. I have a text field with a numberpad below it, I got the numbers to show up in the text field, but am unsure as to how when I hit the enter button - it would store them in a variable?...I am also wondering as to how it would store current value and then allow me to input another value(maybe on the next page) and either subtract or add to it(the first value that is stored). I am also wondering how to get a decimal point in place(need it for currency). Any help would be greatly appreciated! Here is my code: Code: <html> <head> <script type = "text/javascript"> function decPoint(str){ if (str.indexOf('.') == -1) str += "."; var decNum = str.substring(str.indexOf('.')+1, str.length); if (decNum.length > 2) { alert("Invalid more than 2 digits after decimal") } else { alert("Valid no") } } var ent = document.write(document.getElementById("curamt").value); </script> </head> <body border = "1"; color = "blue";> <div id = "cur"> <p>amount is: <script>document.getElementById("amount").innerHTML = ent);</script> </p> <b>Please type in price of item:</b> <form name = "calculator"> <table border = "1"; color = "blue";> <tr> <td colspan = "3" width="75%" align = "center"> <input type = "tel" id = "curamt" name = "tinput" maxlength="4" size="6"> </td> </tr> <table> <tr> <td><input type = "button" name = "one" value = " 1 " onclick = "calculator.tinput.value += '1'"></td> <td><input type = "button" name = "two" value = " 2 " onclick = "calculator.tinput.value += '2'"></td> <td><input type = "button" name = "three" value = " 3 " onclick = "calculator.tinput.value += '3'"></td> </tr> <tr> <td><input type = "button" name = "four" value = " 4 " onclick = "calculator.tinput.value += '4'"></td> <td><input type = "button" name = "five" value = " 5 " onclick = "calculator.tinput.value += '5'"></td> <td><input type = "button" name = "six" value = " 6 " onclick = "calculator.tinput.value += '6'"></td> </tr> <tr> <td><input type = "button" name = "seven" value = " 7 " onclick = "calculator.tinput.value += '7'"></td> <td><input type = "button" name = "eight" value = " 8 " onclick = "calculator.tinput.value += '8'"></td> <td><input type = "button" name = "nine" value = " 9 " onclick = "calculator.tinput.value += '9'"></td> </tr> <tr> <td><input type = "reset" name = "clear" value = " c " onclick = "calculator.tinput.value = ''"></td> <td><input type = "button" name = "zero" value = " 0 " onclick = "calculator.tinput.value += '0'"></td> <td><input type = "submit" id = "amount" name = "enter" value = " e " onsubmit = "ent(); return false;"></td> </tr> </table> </table> </form> </div> </body> </html> |