Instead Of Adding My Numbers Together Its Putting Them Next To Each Other?
Jul 12, 2011
Does anyone know what i'm doing wrong here. Instead of adding my numbers together its putting them next to each other?
This is the javascript...
Code:
This is the form...
Code:
View 5 Replies
ADVERTISEMENT
May 1, 2009
i'm creating a ASP page, which is going to have a form in it that needs filling out. part of the form will be a table with a header row, then the next rows will have text boxes that need filling out. is there a way of putting in a dropdown box that contatins numbers that will dynamically show the rows. for example if i select 5, then five rows of text boxes will appear. if i select 14 then 14 appear.
View 3 Replies
View Related
Mar 8, 2011
import java.util.Random;
import java.util.Scanner;
public class HighLowGame
{
public static void main(String[] args)
{
[Code]....
Two questions, why doesn't my program let me keep putting in numbers until I guess the right one? What is wrong with my loop? Pressing 1 should repeat the program, any other number should close.
View 2 Replies
View Related
Feb 7, 2010
I'm trying to do a homework problem that involves using cookies to add numbers.
Here is what I've done so far:
The code is simply supposed to prompt the user asking how many numbers he/she would like to add. Then it is supposed to have additional prompts asking for each individual number. As the numbers are being inputted, it is supposed to keep a running sum via cookies and then output the total at the end.
The problem that I'm having is that I don't think the cookies are even being created which is weird because the createCookie(), printCookie(), and overWriteCookie() methods are copied directly from the textbook.
View 19 Replies
View Related
Dec 2, 2011
I have an HTML form, that's part of a child window,and has two random numbers in it. How can i have it so when user inputs the sum in an empty box in the form, and clicks 'submit' the result is displayed in the main window? Also, it needs to check if answer is correct or wrong and show that in the main window at the same time.
View 12 Replies
View Related
Oct 19, 2009
I would like to create a Blackjack style game for one of my high school programming classes. I can generate 3 different random numbers and use these random numbers to display an image with that number on it.
How do I add the 3 separately generated numbers together to show the total??
Here is my code so far. Specifically I would like to add the myNumber1(), myNumber2() and myNumber3() results together.
<html>
<head>
<title>Play 21</title>
<script language="javascript">
function myNumber1(){
[Code]....
View 2 Replies
View Related
Aug 25, 2011
I have the following code that I wrote myself (except for the function isNumberKey). However, I don't know how to actually add the numbers together. My plan is to store the value entered in the forms as a variable, then manipulate the variables to get my final number. The final number would be stored in variable named Total and would be displayed after Total: at the bottom of my page.
<HTML>
View 1 Replies
View Related
Dec 16, 2005
I'm wondering how I can add numbers in real time using javascript.
example,
say I enter a number in a text field,
<input type="text" name="qty" value="2">
<input type="text" name="cost" value="5">
how would I then be able to get the total in another test field, like:
<input type="text" name="total" value="10">
View 10 Replies
View Related
May 26, 2009
I am trying to create an html form for adding 2 numbers and also trying to validate using java script. what I want is instead of getting an alert msg as a result
I want the result to be displayed in the sum:text box --- not as an alert I want to validate the input fields ,if null -- throw an alert msg
<!DOCTYPE html PUBLIC "-W3CDTD HTML 4.01 TransitionalEN" "http:www.w3.org/TR/html4/loose.dtd">
<html>
<head>
[Code].....
View 3 Replies
View Related
Mar 22, 2011
Below is the script and form fields I am working with. What I want to do is sum the two textbox fields and have the result show in the total textbox. The code works fine and the total textbox is updated with the value of form1.basic. The problem occurs when I add the "+ parseInt(document.form2.supporter.value)" code in the script section.
View 8 Replies
View Related
Apr 7, 2009
I need to modify the script showed at: [URL]
Right now it allows entering "numbers only", I need it so that it allows numbers and alphabets only, no special characters or spaces.
And yes, one more question, does the first part of the code need to be added in the <head> of the document or <body> ?
The code at the above URL is as follows:
<script type="text/javascript">
// initialise variable to save cc input string
var cc_number_saved = "";
</script>
[Code].....
View 2 Replies
View Related
Mar 13, 2011
Im using Google Maps and when the user moves the map I have an event listener to return a string of routeIDs that are within the bounds of the map.Later on in the page I have a PHP MySQL statement where it Has [ICODE] SELECT * FROM routes WHERE [ICODE] , and after the WHERE I want to add this string.Basically as the user moves the map around, the list of available routes in bounds should change.How can I do this without redirecting pages at all, as that destroys the functionality of the google map?
View 1 Replies
View Related
Jun 2, 2011
I am using DOM table insertrow as such:
Code:
var _table = document.getElementById("TableList").insertRow(0);
_table.border = 1;
var cell0 = _table.insertCell(0);
var cell1 = _table.insertCell(1);
[Code]....
but it does not seem to work. how to get a border on the individual row?
View 1 Replies
View Related
Mar 18, 2010
I have a link and i am putting the id in href.
Code:
<a href="12345" id="myLink">link</a>
In IE 8.0.6 and 6.5 (not my machine but on coworkers machine) when link gets clicked, i get full path including the ID like "http://www.domina.com/folder/12345" where as on my machine i get the ID only when i do
Code:
myval = $("#myLink").attr("href");
When i move the ID to rel attribute, the browsers behave as intended.
Code:
myval = $("#myLink").attr("rel");
same version of IE on my machine is behaving ok where as on coworkers machine it is not. Am i doing some thing wrong here?
View 6 Replies
View Related
Jul 19, 2011
Is there any reason why doing...
var chords = document.getElementById('chords');
chords.style.backgroundPosition = (pos+6) + 'px';
Wouldn't work, where... document.getElementById('chords').style.backgroundPosition = (pos+6) + 'px';
Also, after saving it into a variable, asking the console what is in the variable it pulls up... <div id="chords" style="background-position: 1606px 50%; "></div>
Just that, in my mind, saving a set of tags to memory rather than searching for it every 40ms seems to be a better way of going about it. But if I try to do it this way I get given a... "Uncaught TypeError: Cannot read property 'style' of undefined"
View 4 Replies
View Related
Mar 12, 2011
I need some help putting the factors of a number (y) into an array.For example if y = 20: [1, 2, 4, 5, 10, 20]Once I have this, I can use it to factor a quadratic:(ax = c)(bx = d)if c = 3 and d = 5 then I could check if 1c was a decimal, if 20d was a decimal and then vice versa.Basically, I can use these numbers to see if b or d is a whole number and if it isn't, try the next one.If none of them are, then I can do y(ax + c)(bx + d)
View 4 Replies
View Related
Sep 20, 2010
I'm using this to put menus on my website
[URL]
at the top it says its capable of having more than one menu on a page, but it doesnt give the directions.
View 7 Replies
View Related
Jul 9, 2011
I have a button and a textarea. I want this button to add tags around the selected words in that textarea. For example the button is to add the <b> tag before the selected words and the </b> tag after the selected words. Just like these buttons, in the forms of creating a new thread,that are used to make the font of the selected words bold, italic, underlined or colored.
View 5 Replies
View Related
Jul 23, 2005
I implemented some code to perform highlighting and specific anchors are used for the searched words. The problem is when the searched words are inside <a href> tags, the links are lost after putting my anchors.For example:
View 1 Replies
View Related
Mar 30, 2010
I was wondering if it is possible to put all the non null variables of an array into a string variable with spaces between each array value? For example, if array() is a text array and has 10 values, array(0) through array(9), with three of those values null, let's say array(3), array(5), and array(7) are null, is there a way to put the remaining seven values into a string variable with spaces between each array value?
View 2 Replies
View Related
Apr 29, 2011
So i been doing this color changing and text chaning randomly my text changes randomly but i need the background of the box to change the codes i type in make the entire web site change color but i need the box and this is what im writing
<html>
<head>
<title>HTML and JavaScript</title>
<link href="capstone.css" rel="stylesheet" type="text/css"></link>
<script>
[Code].....
View 5 Replies
View Related
Jul 1, 2011
set up a simple Function that allows me to create a thumbnail image viewer with headings and text.
One of the variables is a Hyperlink.
It all works fine but I want the hyperlink to open as a PopUp Window, but not sure how to do it.
My Code
function LoadGallery(pictureName,imageFile,titleCaption,captionText,titleText,textText,titleJob,jobText,title Pricelist,pricelistText)
{
var picture = document.getElementById(pictureName);
[Code].....
but what I want is when you click on the text "Click here to see Gemma's Service Price List" (specific to Gemma of course).
.... her price list opens in a popup?
(If you want to try this Gemma is the Director with the Burgundy haircolour, top left on the page).
P.S. I am using the <div class> and id to pass the variable data through the function and display the enlarged image and relevant text and hyperlink... if that makes sense ?
View 6 Replies
View Related
Jul 6, 2006
I wish to use J.S. to obtain the screen ht and put this value into a hidden
field for posting. so that I can then use it in a php file.
A simplified script of what I am trying to do is below, but it doesnt work.
I have not used javascript much and I'm sure its straight forward.
<script type="text/javascript" language="javascript">
var ht = document.body.clientHeight;
</script>
<form action="my.php" method="post">
input name="screenht" type="hidden" value="ht"
</form>
View 5 Replies
View Related
Dec 18, 2010
Im just getting started with jQuery and have successfully made a div "slideUp".I was going to put a long div on the top of a page with a message, show for a few seconds, and then slide up to disappear. I've seen that technique used quite a bit lately.Is there a way I can delay the run of my slideup function? I'd rather it be timed or delayed, than click to close.
View 1 Replies
View Related
Mar 29, 2010
I have to send a several arrays as query parameters to a Spring server.
The payload I'm trying to send is this:
[Code]...
Please help. This kind of thing is driving me nuts. I hate working with primitive stuff and having to do a lot of redundancy just to get data transmitted. I just want it to work with the domain object model on the server... but there's always these weird exceptions that make that impossible. It's amazing that in 2010, we are still working in basic numbers and arrays and having to take apart and put together data at a primitive level.
View 15 Replies
View Related
Mar 30, 2011
I have been tearing my hair out with this for the past 12 or so hours and am no closer to a solution than when I began.
I have a jquery function to dynamically create <li> tags for an unordered list:
$(function() {
var idealist = $('#idealist');
$('.checklist').click(function(event){
item = '';
[Code].....
This is working fine. The problem is I need to somehow pull the ids from each <li> tag into a string or an array that can be made available somehow to php code for further processing. I can create the string or array within my jquery function but can't figure out how to make that available to php.
View 10 Replies
View Related