PDA

View Full Version : delete button on on screen keyboard



codrakon
01-13-2006, 09:06 AM
i am having difficulty make the delete link for my on screen keyboard work. does anyone have any suggestions?

//JavaScript Document
function Append(letter)
{
input.comments.value = input.comments.value + letter;
}
function backspace()
{ var l = input.comments.value.length - 1;
input.comments.value = input.comments.value.replace(input.comments.value.charAt(l),"");
}

<%@ Page language="c#" Codebehind="feedbackcontentwriter.aspx.cs" AutoEventWireup="false" Inherits="HealthKiosk.Default.feedback.feedbackcontentwriter" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>feedbackcontentwriter</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="../../../scripts/css/healthkiosk.css" type="text/css" rel="stylesheet">
<script language="JavaScript" src="../../../Scripts/JavaScripts/preloader.js" type="text/javascript"></script>
<script language="JavaScript" src="../../../Scripts/JavaScripts/keyboard.js" type="text/javascript"></script>
</HEAD>
<body class="content" MS_POSITIONING="GridLayout">
<form name="input">
<div align="center">
<form runat="server">
<textarea cols="120" rows="10" name="comments"></textarea>
<br>
</form>
<br>
<table>
<tr>
<td colspan="2">
<table align="center">
<tr>
<td width="60" height="60"><A onclick="Append('`')" href="#">`</A></td>
<td width="60" height="60"><A onclick="Append('1')" href="#">1</A></td>
<td width="60" height="60"><A onclick="Append('2')" href="#">2</A></td>
<td width="60" height="60"><A onclick="Append('3')" href="#">3</A></td>
<td width="60" height="60"><A onclick="Append('4')" href="#">4</A></td>
<td width="60" height="60"><A onclick="Append('5')" href="#">5</A></td>
<td width="60" height="60"><A onclick="Append('6')" href="#">6</A></td>
<td width="60" height="60"><A onclick="Append('7')" href="#">7</A></td>
<td width="60" height="60"><A onclick="Append('8')" href="#">8</A></td>
<td width="60" height="60"><A onclick="Append('9')" href="#">9</A></td>
<td width="60" height="60"><A onclick="Append('0')" href="#">0</A></td>
<td width="60" height="60"><A onclick="Append('-')" href="#">-</A></td>
<td width="60" height="60"><A onclick="Append('=')" href="#">=</A></td>
<td width="60" height="60"><A onclick="backspace()" href="#">BackSpace</A></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><table align="center">
<tr>
<td width="60" height="60"><A onclick="Append(' ')" href="#">tab</A></td>
<td width="60" height="60"><A onclick="Append('q')" href="#">q</A></td>
<td width="60" height="60"><A onclick="Append('w')" href="#">w</A></td>
<td width="60" height="60"><A onclick="Append('e')" href="#">e</A></td>
<td width="60" height="60"><A onclick="Append('r')" href="#">r</A></td>
<td width="60" height="60"><A onclick="Append('t')" href="#">t</A></td>
<td width="60" height="60"><A onclick="Append('y')" href="#">y</A></td>
<td width="60" height="60"><A onclick="Append('u')" href="#">u</A></td>
<td width="60" height="60"><A onclick="Append('i')" href="#">i</A></td>
<td width="60" height="60"><A onclick="Append('o')" href="#">o</A></td>
<td width="60" height="60"><A onclick="Append('p')" href="#">p</A></td>
<td width="60" height="60"><A onclick="Append('[')" href="#">[</A></td>
<td width="60" height="60"><A onclick="Append(']')" href="#">]</A></td>
</tr>
</table>
</td>
<td rowspan="3"><A onclick="Append('\n')" href="#">enter</A></td>
</tr>
<tr>
<td colspan="2">
<table align="center">
<tr>
<td width="60" height="60"><A onclick="Append('!!!!!')" href="#">CAP</A></td>
<td width="60" height="60"><A onclick="Append('a')" href="#">a</A></td>
<td width="60" height="60"><A onclick="Append('s')" href="#">s</A></td>
<td width="60" height="60"><A onclick="Append('d')" href="#">d</A></td>
<td width="60" height="60"><A onclick="Append('f')" href="#">f</A></td>
<td width="60" height="60"><A onclick="Append('g')" href="#">g</A></td>
<td width="60" height="60"><A onclick="Append('h')" href="#">h</A></td>
<td width="60" height="60"><A onclick="Append('j')" href="#">j</A></td>
<td width="60" height="60"><a href="#" onclick="Append('k')">k</a></td>
<td width="60" height="60"><a href="#" onclick="Append('l')">l</a></td>
<td width="60" height="60"><A onclick="Append(';')" href="#">;</A></td>
<td width="60" height="60"><a href="#" onclick="Append('\u0022')">"</a></td>
<td width="60" height="60"><a href="#" onclick="Append('|')">|</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><table align="center">
<tr>
<td width="60" height="60"><a href="#" onclick="Append('\\')">\</a></td>
<td width="60" height="60"><a href="#" onclick="Append('z')">z</a></td>
<td width="60" height="60"><a href="#" onclick="Append('x')">x</a></td>
<td width="60" height="60"><a href="#" onclick="Append('c')">c</a></td>
<td width="60" height="60"><a href="#" onclick="Append('v')">v</a></td>
<td width="60" height="60"><a href="#" onclick="Append('b')">b</a></td>
<td width="60" height="60"><a href="#" onclick="Append('n')">n</a></td>
<td width="60" height="60"><a href="#" onclick="Append('m')">m</a></td>
<td width="60" height="60"><a href="#" onclick="Append(',')">,</a></td>
<td width="60" height="60"><a href="#" onclick="Append('.')">.</a></td>
<td width="60" height="60"><a href="#" onclick="Append('/')">/</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><table align="center">
<tr>
<td width="60" height="60"><a href="#" onclick="Append(' ')">space</a></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</form>
</body>
</HTML>

jscheuer1
01-13-2006, 09:49 AM
There is no case insensitive string match for 'del' anywhere in your supplied code. Are you sure you don't mean that you are having trouble with the backspace key?

Twey
01-13-2006, 04:05 PM
function backspace()
{
input.comments.value = input.comments.value.substring(0, input.comments.value.length - 1);
}