# Create A Function That Prompts User For A Number

Oct 26, 2011

Create a function that prompts user for a number. Develop the program so that it continues to prompt until it receives valid information. Then create a multiplication table that displays the number multiplied by 1 through prompted number.

## School Assignment - Create A Function That Prompts User For A Number

Oct 26, 2011

- Create a function that prompts user for a number.

- Develop the program so that it continues to prompt until it receives valid information.

- Then create a multiplication table that displays the number multiplied by 1 through prompted number.

How to get the function to work.

## Create A Script That Allows User To Enter A Number?

Sep 29, 2009

I need to create a script that allows a user to enter a number, in either celsius or fahrenheit textbox....then they can click the button and the conversion is placed in the blank textbox

C = (F 32) * 5 / 9
F = C * 9 / 5 + 32

<table border="1">
<tr>
<th>Fahrenheit</th>
<th></th>

[Code]....

## Multiple Prompts>formulas>answer | Performing Trig Based On Prompts?

Mar 26, 2009

I am trying to set up a simple web page that requests two inputs and upon these input, determines and angle (basically taking a Spur Gear Pitch � and threads pitch to get a cam angle). Here is what I have but it is not working. I actually want it to work onClick of a button but I can deal with that later. I just am not sure how to get this to work properly.

<html>
<script language="JavaScript"><!--
function getCirc(dia){
return dia*Math.PI;
}
[Code]....

## Form Confirmation - Validated Prompts The User If The Details Are Correct

Nov 15, 2011

Have made a contact form for a website that uses javascript to validate it then once validated prompts the user if the details are correct. Currently its working in chrome and ie but not in firefox. Code is in post #3.

## Script That Is Supposed To Check If A Number The User Guesses Is The Same As The Randomly Generated Number?

Nov 11, 2011

I have this script that is supposed to check if a number the user guesses is the same as the randomly generated number.Problem is that the random number generated at the start of the program keeps on changing everytime I click on the "Check if I'm right" button, the random number gets generated again and I never ever get to reach the correct answer

HTML CODE
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

[code].....

## JQuery :: Create A Function To Show A Custom Message As A Tooltip When A User Hovers Over A Table Row

Mar 10, 2011

I'm trying to create a function to show a custom message as a tooltip when a user hovers over a table row.

My tr tag looks like this

The javascript function looks like this:

jQuery seems to be loaded correctly, as I get the alert. I don't get the tooltip, however.

What I'm trying to do, in case this is totally retarded and impossible to see, is to hover a tooltip over the clicked row instead of passing it in as a variable.

Jul 20, 2005

Is there a way to modify the font in the alert & prompts windows?

## Add If Statement To Limit Number Input By User To Less Than 20?

Oct 29, 2009

How would I add an if statement to limit the number input by the user to less than 20?

## Create A Script That Will Increment A Number By 0.01?

Feb 12, 2011

working on building a website at the moment. and i need to create a script that will increment a number by 0.01, then stop and decrease by 0.03, then increase again by one. I wrote code to increment by 0.01 continuouly but now i can't stop it. and change to decreasing

<script type = "text/javascript">
num = 0.87;
var tim = 0;

[code]....

## Create Random Number Between 1 - 50 With Decimals?

May 24, 2011

How would I go about creating a random number between 1-50 that COULD include whole numbers, decimals to the tenth, hundredth and the thousandth place?
Ex) 2.145, 3, 5.8, 41.002, 10.12, 7, 18.023, 33.2

Also, if the only way to do it is to put trailing zeros to the thousandth place that's fine as well
Ex) 2.145, 3.00, 5.800, 41.002, 10.120, 7.00, 18.023, 33.200

## Mac / Firefox - Verify That A User Has Entered A Number Between 0 And 99 In A Form

Jun 24, 2011

I use the following to verify that a user has entered a number between 0 and 99 in a form:

It seems to work fine in all browser / machine combos except Firefox on a Mac, when entering 0 returns false (I don't know if entering other numbers also returns false.)

## Making A Diamond With Number Of Stars That User Inputs?

Oct 26, 2011

I'm new here, and I'm a programming newb but am very interested in learning and possibly pursuing programming in the future. As such, I'm taking an intro to Javascript class at my university, and our homework is to make a function that when called upon makes a diamond out of *'s. It is supposed to do so by prompting a user for an int and then makes a diamond shaped object with the inputted number of stars in the middle of the diamond. an example of what this would look like (if a user entered in "5" to the prompt):

[Code]...

## Validate That User Has Entered A Ten Digit Number Into The Text Box?

Mar 18, 2011

I need to validate that the the user has entered a ten digit number into the text box, and need some help with the code. Here is what I have:

<html>
<title>Checking with RegExp</title>

[Code].....

## Accept Two Numbers From A User And Will Determine Whether The Second Number Is A Factor Of The First

Oct 23, 2011

I have been presented with: Draw a flowchart and write a javascript program which will accept two numbers from a user and will determine whether the second number is a factor of the first. This is determined by dividing the first number by the second and checking if the remainder is 0. This is made easier if you find out what the operator does. The output should be in the form 4 is not a factor of 6 and 3 is a factor of 6. I have tried a few attemps and yet still not sure what the problem is :confused:

[Code]....

## Create An Array Of Numbers Counting From 1 To A Given Number?

Mar 20, 2009

I just want to create an array of numbers counting from 1 to a given number.

At the moment I have the for loop running like this:

var i=0;
for (i=1;i<=10;i++)
{
if (i == 1)

[Code]....

This outputs 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

How can I put this output into this variable: 'var ids' so I get out

var ids= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

## Create Phone Number Form Script?

Nov 30, 2009

How do i create a phone number form box in javascript using no inner html . there must be at least one dash in it. code...

## SIMPLE PROGRAM: User Enters Number, Gets Personal Message

Jul 23, 2005

I am trying to put up a page for my students for them to be able to enter
their class number into a field and instantly get a personalized text
message. (ie student number 5 enters "5" and gets a message like
"Congratulations on your homerun in Kickball Bobby!"

## Allow User To Input A Number Say 1-200 And That Variable Would Make Up The Last Part Of An IP Address

Feb 5, 2011

I need to get a piece of code that will allow me to have a user input a number, say 1-200 and that variable would make up the last part of an IP Address that the user wants to browse to.

192.168.0.[variable]

Is there a script that will allow me to do that?

## Can't Show A Text - Number , Character To User When I Load Page / Fix It?

Jul 26, 2009

I have a character countdown that tell you how many characters you have type in the text area. But I am having a problem, I can't see to show a text or the number the character the user when I load the page. I want it to show Characters Type: 0 when you load the page, and not having to press a key to show it, here is the code I am using...

## Create A Water Bill That Calculates The Number Of Gallons

Mar 15, 2010

I have a javascript class and one of the assignements that we had to do was create a water bill that calculates the number of gallons used and the price for the water consumption. It will not work at all...

## How To Create A Random 15 Letter/number Piece Of Text?

Nov 10, 2005

How do I create random 15 letter/number piece of text that is composed of letter and numbers jumbled together then automatically place that in a field? This is all of course activated by a link.

## Create A Form Which Has A Dynamic Number Of Text Fields?

Sep 24, 2011

I need to create a form which has a dynamic number of text fields. So, I created this input type :

PHP Code:
<input id="benamount" name="benamount[]" type="text" disabled="disabled" size="40"/>
<input type="checkbox" name="ben[]" onchange="check();"/>

[code]....

## Creating A Form That Will Change The Number Of Fields Based On User Input

Jan 4, 2006

I have a form that collects information about up to 5 items. I would
like the user to be able to select from a drop down menu how many items
for which they want to compare information, and then have the form
change the number of input fields accordingly.

In other words, if the user selects enter info for 3 items, then input
fields for only 3 items are shown, if they change it to 4 items, then a
fourth column shows up in the table with the appropriate input fields.

## Generates A Random Number Between 1-1000 And Then Allows The User To Make Guesses In A Text Box

Apr 15, 2010

I'm having to write a program that generates a random number between 1-1000 and then allows the user to make guesses in a text box, answering to high or to low, until the correct answer is entered. I had the program working fine with using strictly prompts and alerts but when I tried to create a form I started having trouble.

<?xml version = "1.0" encoding = "utf-8"?>
<!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">
<title>9.30</title>
[Code]...

## Concatenate Two Prompts And Display The Result In An Alert Box

Mar 29, 2010

I am going to concatenate these 2 input values together and display the result in an alert box. These two input are from two prompts.

[Code]...