In java, how to convert the inputed value in the text field to variables?
152853
press the convert button
1069483
Try using String.Format()\n\nFor example:\n\nString.Format("Hello {0}, you are {1}",\n      value1,\n      value2)
707422
That is javascript... html does not have variables!\n\nyou could do it without a <script> tag... is that what you meant?
134750
You are returning an ArrayList, so are we to assume the field you want is in the first entry?\n\nlabel.text = ctype(randomMessage(0), string)
612072
use an array of string that the combo.itemdata value points to that string array. usefull?\n\n<finglish text>\nagar tozihe bishtar bedahid shayad bishtar betavanam komak konam.\n</finglish text>
209872
I already answered this for you in your other thread, using Visual Basic. With a little effort, you ought to be able to convert one type of Basic to another. The languages are virtually identical.\n\nOnce again, what you need to do is create a function. Let's call it DozenBetType. It is going to take one argument: an integer: DozenBetType(someInteger)\n\nThe function is going to return:\n1 if the number passed to it is 1-12\n2 if the number is 13-24\n3 if the number is 25-36\n\nThen you can simply call the function on both the number guessed and the number your program has generated.\n\nFor example, if the number your program generated is declared as intResult, and the number the person guessed is declared as intGuess:\n\nif DozenBetType(intGuess) = DozenBetType(intResult) then they have won the bet, otherwise they have not. (A simple if-then-else statement\n\nIf you don't want to use a function, or if that's too complicated for you, you can declare two new variables: intDozenTypeResult, for the number your program generated and intDozenTypeGuess, for the number your user guessed.\n\nSet intDozenTypeResult to be 1 if the program's random number is between 1-12, set it to be 2 if the value is 13-24, set it to be 3 if the value is 25-36. \n\nDo the same thing for intDozenTypeGuess.\n\nThen, simply compare those two variables:\n\nIf intDozenTypeResult = intDozenTypeGuess then they have won, otherwise they have not (again, a simple if-then-else statement).\n\nPlease, don't create new threads for the same question. Just update your old question.
87907
The previous answer is correct.  The Javascript prompt just gets the value into the CLIENT side - it does not invoke the SERVER side, where the aspx runs.  Somehow, after you do this, you have to send the request to the server.\n\nLogically, in you application, is there a form the user is filling in?  If so, pass the value in the form as a hidden field or on the query string.\n\nOr, are you wanting to end the current page right after the prompt, and go directly to the page the aspx builds?  If so, immediately after your prompt, do a\nlocation.replace="http://...nameofpage?valueInAspx="+variablevalue\nand pick in up in the request collection.
292438
Taking input in commandline is not as simple as it is in C of c++. U need use Sytem.in and get the inputstream and then use it.\n\nI recommend u to use swing JOptionPane that shows a input dialog and and get the input from the user.\n\nHere is the sample using Swing\n\nimport javax.swing.JOptionPane;\n\npublic class UserInput\n{\npublic static void main(String[] args)\n{\n    String str = JOptionPane.showInputDialog( null , "Enter Something");\n    System.out.println(str);\n}\n}
992875
could you be more specific?\n\nYou could do this in Java script. \n\ndepends upon what the Dialog box is supposed to do
667631
Add your HTML Code in the specified place \n\nReplace fieldname with the textbox name. For example if your text box name was "age", and it should redirect the user if the user is below 18 years, the statement should read:\nif (document.formname.age.value<18) {\n\n\n<form name="formname"> \n<!--- Your HTML here --->\n<input type="button" onclick="gotopage();"\n</form>\n<Script language="javascript">\nfunction gotopage()\n{\nif (document.formname.fieldname.value=="Option1") {\nlocation.href="page1.htm";\n}\nelse {\nlocation.href="page2.htm"; \n}\n}\n</script>
875702
can't you just loop through the array, have a variable for smallest number and one for position. \n\nthen in the loop, if current array value < than variable set the variable = to the current array value and set the variable pos = pos in the array\n\nthat way, when the loop ends, your two variables will hold the smallest value and the position in the array of that value,\n\nhope that's what you're after\n\ngood luck  :¬)
1084101
You must cast legs to an integer using parseInt\n\nlegs = parseInt(legs);
120283
You need to define a subroutine which will run when the user 'exits' the first field:\n\nPrivate Sub Field1_Exit(Cancel As Integer)\nField2.Value = Field1.Value\nEnd Sub\n\nYou might have to experiment a little to get this to do exactly what you want.  You may have to use "Field1.Text" instead of "Field1.Value".  You can also catch the "Change" event and get the two fields to track keystroke by keystroke.\n\nAn alternative to catching the "Exit" event is to catch the "LostFocus" event.
878923
Make a program on your calculator.\nView the snippet in the link for code.
146941
In calculated query field:\n============================\nTotal: [Field1]*[Field2]\n\nIn a form field:\n===============\n=[Field1]*[Field2]
845955
If it's a textbox,\nstring strVal = txtControl.Text; // you can aldo do .Text.Trim();\nIf it's a dropdown\nstring strVal = (string) ddlControl.SelectedItem.Value;\n\nSome objects have string properties (.Text) you can access directly and store into string variables; others have "object" types (.Value) that you'll need to cast.  Then you can also convert them to other types by writing\nint iVal = Convert.ToInt32(strVal);\nfor free-hand input, beware of conversion exceptions.\n\nYou can collect the user input either upon clicking of a button (set up an event handler for the button's Clicked event) or by handling the TextChanged or ValueChanged events of controls.\nCreating event handlers is best and most accurately done via the designer.
946107
Personally I think this is a java question, not a javascript.  Anyhow, I am not going to argue with that.\n\nIf you have your Prompt Box and can get the information from it, the following methods may help you.\n\n// Arrays to hold the seles person data\nString[] salesperson_names = new String[100];\nint[] salesperson_cars_sold = new int[100];\ndouble[] salesperson_sales_amount = new double[100];\n\nint counter = 0;\n\n// method to store data\nvoid inputData(String name, int cars_sold, double total) {\nsalesperson_names[counter] = name;\nsalesperson_cars_sold[counter] = cars_sold;\n// etc.\ncounter++;\n}\n\n// for the average, do a for loop\nint accumulator = 0;\nfor (int i = 0; i < counter; i++) {\naccumulator += salesperson_sales_amount[i];\n}\nint average = accumulator / counter;