Tag archive for ‘textbox’

How to use onChange() to change assign value to a textbox?

Question:
I’m writing a function in JavaScript to assign a value to the textbox whenever a different option is selected from the drop-down list. I tried to use onChange to still failed to achieved the correct result. I need to know what’s wrong with my code. Below is my coding:
<script>
function changeOption(num)
{
var obj = document.searchfrm;
obj.numtype.value = [...]

Allowing numeric data not greater than 99.99 in HTML textbox onkeypress

Question:
Hi,
I have written the following code to allow user to key in only numeric data onkeypress in a textbox.
But I dont want to enter data greater than 99.99 onkeypress  in the textbox.Is it possible?
<html>
<head>
<title></title>
<script>
var filterArrayNumbersOnly = new Array(“48″,”49″,”50″,”51″,”52″,”53″,”54″,”55″,”56″,”57″);
var filterArrayCurrency = new Array(“46″).concat(filterArrayNumbersOnly); //  . and numbers
function filterAny(key, goodKeys)
{
var alwaysGood = new Array(“20″,”8″) // capslock, [...]

TextBox[i].Text – Is this possible?

Question:
I would like to pass a variable to some declared textbox controls to display different numbers.
I am wondering if there is a way to do this:
For i=0 to i=4
TextBox[i].Text = i
Next
Thanks
Solution:
I just did this with label controls.
Put controls on your form.  Name them  TextBox1 , TextBox2 , TextBox3,  etc…
then in your code, you can do [...]

textbox imput.. into array into database..

Question:
I have something like this that inputs the values from a simple form into a database:
if (isset($_POST['key']) && trim($_POST['key']) != ”) {
// for easier variable handling…
$camp = $_POST['camp'];
$group = $_POST['group'];
$key = $_POST['key'];
$domain = $_POST['dom'];
$bid = $_POST['bid'];
// insert new entry into database
$sql = “INSERT INTO listing (camp_name,group_name,key_name,dom,bid) VALUES (‘$camp’,’$group’,’$key’,’$dom’,’$bid’)”;
$result = mysql_query($sql, $connect) or die(mysql_error());
echo mysql_error();
echo [...]

how to read iframe textbox values when i click save button in main page.

Question:
this is main.jsp in that included iframe which will call another jsp;i put save button in main.jsp page.when i click save button in main jsp its reading main jsp textbox values like(emp ID,Desc.)  but not reading iframe(ex.jsp) textbox values.
<head>
</script>
</head>
<body>
<form name=”form1″>
<table width=”100%” cellspacing=”3″ cellpadding=”0″>
<tr>
<td>EMP ID</td>
<td><input type=”text”  name=”processId” tabindex=”100″ value=”” />
</td>
<td >EMP Desc</td>
<td><input type=”text”  name=”processDesc” value=”/></td>
</tr>
<tr [...]

PHP textbox validation help

Question:
I want to have some validation for the info that is enter from my customer.
I purposely enter wrong information and the code still let it go through.
The code is in PHP, can someone help plz.
<? include(“vars.php”); ?>
<? include(“functions.php”); ?>
<?
if (file_exists(“header.php”))
include(“header.php”);
?>
<? dispHeader($categ,$search,$cat); ?>
<?
?>
<script language=”JavaScript”>
<!–
function change_freight(theForm,theSelect) {
theForm.freight.value = theSelect[theSelect.selectedIndex].value;
theForm.total.value = (1.0 * theForm.totalxfreight.value) + (1.0 * [...]

MaxLength Doesn’t Work With Javascript Turned Off???

Question:
Yikes, I have a web control:
<asp:textbox ID=”mytext” TextMode=”MultiLine” MaxLength=”3500″ runat=”server”/>
but when JavaScript is turned off, the textbox will not limit user input.  However, a single line textbox will limit user input to the specified MaxLength.
Why is this and how to fix?  I really need it to work with JavaScript turned off.  Is putting a validation [...]

Save data from textboxes to database

Question:
Where I am now:
Currently I have a typed dataset with 10 relational tables in it.  They are populated with 10 table adapters pulling from stored procedures.
The typed dataset is populated on the Page_Load event.    I need to construct a large web form with many textboxes and and a few datagrids.  I am not sure [...]

Want to anchor a textbox directly over a DataGridView column.

Question:
HI.
I am using vb.net 2005
I have a DataGridView. I have been able to dynamically create and align textboxes over the columns in my datagrid.  The problem is that the datagrid is wider than the screen.    If the user scolls right, then the textboxes remain fixed while the datagrid columns move left.
I was hoping to [...]

mask a textbox entry

Question:
I would like to have a user enter a password into at textbox, but want it masked with “*” so others can not see it.  How can I do this?  Thanks, Chad
Solution:
Set the PasswordChar property to “*”