Preventing Users From Entering Non-numeric Characters?
Dec 29, 2010
I have the following code that i am using to try and prevent users from entering non-numeric characters but it doesn't seem to work:
PHP Code:
function validate_onkeypress() {
a = String.fromCharCode(event.keyCode);
b = a.charCodeAt(0);
if (!validateString(b)) return false;
[Code]...
View 6 Replies
ADVERTISEMENT
Jul 20, 2005
I have a text area and I want prevent people from entering HTML text in the text area....
View 3 Replies
View Related
Apr 14, 2011
I am building a user-based online application using jquery, and I am concerned about the possibility of users being able to hijack my ajax functions. I'm sure there is a standard way of dealing with this, but I don't know what it is.For example, if users are logged in,and want to send an instant message to each other, they can use a simple messaging system.An ajax call passes their message to a back-end handler script, like so:
$.ajax({
type: "POST",
url: "back-end-handler.php",
[code]....
View 7 Replies
View Related
May 18, 2010
i m working on a website. in which i m using a page which calls on index.php after that web address is called. as it has JS function which make index page open in popup. what i wanna do is now is that if someone (as many of us know root page 90% is index.php), if anyone enter index page directly. JS should check if that person came from redirect.php or not. if not, he will have some sort of error msg.
View 1 Replies
View Related
May 7, 2006
Instead of searching and replacing unwanted character in strings using cgi/perl, I would like to prevent some characters from ever being typed in text boxes and textfields. Two characters I would like to stop are "|" (pipe symbol) and the "carriage return". I am not even sure how to search and/or replace a carriage return in a string anyway. This may be a JavaScript function, because what I would really like to do is send an alert to tell the user that it is not allowed.
View 2 Replies
View Related
Oct 3, 2011
This has been asked before, and i've seen many of the previous posts. And tried for hours. But finally i've broken and have to ask for help. What am I doing wrong here?
var u=document.forms["lead"]["name"].value;
var v=document.forms["lead"]["city"].value;
var x=document.forms["lead"]["country"].value;
var y=document.forms["lead"]["mobile"].value;
var z=document.forms["lead"]["email"].value;
[Code]...
View 5 Replies
View Related
Oct 12, 2006
I am doing some basic form validation stuff and I have two fields (phone, fax) that I need to check if the characters enterred are numeric, but still allow + and () characters to be enterred. If anything else has been enterred to display an error message.
Can someone point me to a resource ( I searched, but couldn't find an obvious one!) or give me a rundown on some code here to help me out?
View 2 Replies
View Related
Oct 27, 2009
I have a script that limit characters and lines entered by users in a textarea.. I want instead of throwing that alert message to jump to the next line and the user can continue writing, here is the script:
<script type="text/javascript">
var alert_title='Input Restriction';
function limitTextarea(el,maxLines,maxChar){
if(!el.x){
el.x=uniqueInt();
el.onblur=function(){clearInterval(window['int'+el.x])}
}window['int'+el.x]=setInterval(function(){
var lines=el.value.replace(/
/g,'').split(' .....
The HTML
<textarea onFocus="limitTextarea(this,5,40)" wrap="soft">
View 2 Replies
View Related
Jul 23, 2005
We're in the process of re-writing the Intranet at work, and my javascript
knowledge could be written on the back of a post card. ;-)
Can any of you point me in the direction of some code that would enable a
form to open a specific pdf file? Details are below.
--------------------
All of our purchase orders are saved back to pdf files. Each pdf has the
prefix "PO_" followed by the po reference, then the file extension ".pdf".
For example, our file would be called "PO_12345M.pdf".
Each set of files is archived into years (folders are called 2003, 2004,
2005 etc.) so it will probably need a drop down box to select year, unless
it can search through all the folders.
The visitor should only need to enter the PO reference, and the code puts
the "PO_" and the ".pdf" on the end of it, and hey presto Acrobat opens with
the PO, or you get an error dialog if the file cannot be found.
--------------------
View 2 Replies
View Related
Jul 20, 2005
I keep getting a runtime error stating that this
document.adddealer.dealertoadd.value = dealer; is null or not an
object. I've rewritten the Function everyway I could think of, and
couldn't find any thread examples of my problem.
Here is my Function;
<Script language="JavaScript">
<!--//hide
function AddDealer(dealer) {
document.adddealer.dealertoadd.value = dealer;
document.adddealer.submit();
}
//-->
</script>
This calls the Function;
<input type="button" value="Make This My Dealer"
name="button">
When the code breaks and I bring up Microsoft Debugger it shows a
value in the parameter.
View 6 Replies
View Related
May 16, 2010
My program should display '*' when entering a password to a text box by a user. How to do that?
View 4 Replies
View Related
Oct 29, 2004
<form action="action.htm" method="post" >
<input name="title">
<input type="submit" value=" post ">
</form>
I have the above form code. I like to make users not to enter two words, for example "FK" and "ST."
View 3 Replies
View Related
Sep 3, 2010
i got the html page from [URL]... i want to add a text box and to enter a number so that the entered number's image will be dispalyed in the div
View 4 Replies
View Related
Jan 7, 2010
I'm wanting to create a pop-up window that shows upon entering on the website with two buttons that have different functions.
I'm wanting the first button, when clicked, stops the message from appearing again.
-Similar to the "do not show again" option that uses cookies from this thread.. [URL] the second button, when clicked, redirects the user to a URL
Is it as simple as using the code from the thread above and some simple javascript buttons?
View 2 Replies
View Related
Jul 3, 2009
<script type = "text/javascript">
function testfield() {
var un = document.getElementById("dir").value;
if (!/^(/ftp/nas)/i.test(un)) {
alert ("Invalid starting characters - must be /ftp/nas");
return false;
[Code]...
I have a code like above which doesn't allow the user to proceed with out starting the field with a "/ftp/nas" which should be the starting of a path. Is there any way to make it disabled and the user only can enter the rest of the path. for eg: user1 has directory path like /ftp/nas/user1/help
so when this user enters his path, on the field "/ftp/nas" should always be available and the user has to only enter the rest of the path. and the user is allowed to enter only / (// is not allowed) and [A-Za-z] in the field. this is just to secure the application from typing mistakes.
View 3 Replies
View Related
Aug 29, 2009
I am just wondering if someone can tell me what this message means, even roughly. The following is the error message box that pops up when I try to access/open a yahoo email account. The error (in english) is followed with some script referred to. I am very "curious" what this is. ANY suggestions welcome.
View 1 Replies
View Related
Jan 25, 2006
I am having problems with the code below (obviously) coming up with illegal character for various characters within the field name
which is: S_Gift Finder1_0
I have tried various ways of escaping the characters but to no avail.
I am unable to change the name of the field as it it comes from an external off-the-shelf package. Code ....
View 4 Replies
View Related
Sep 19, 2007
I have character counter for textarea wich counting the characters.
Special character needs same place as two normal characters because of
16-bit encoding.
Counter is counting -2 when special character is added like some
language specific char.
How to count specials like 1 char?
View 3 Replies
View Related
Jun 18, 2010
I'm interested in learning how to do this. What I'm doing is I'm making a social networking site linked to a game called Habbo, and for the registration page, once they put in their Habbo Username, I want to be able to load the image next to it. [URL]...
That is the link to the image. So basically, once they enter a value into the textbox, I want to be able to use that value to replace the [TEXTBOX.DATA] part from the above link and use that as an image.
View 5 Replies
View Related
Jan 22, 2011
I need to check form field contains existing data(want to check database) are not. if that field contain existing data it wants give alert.., In database i set projectcode as Unique.if 1st user giving projectcode as 1 it wants to store. if 2nd user giving the same projectcode it want's to throw alert msg.., But i need to learn step by Step. So i created Form with one Field(ProjectCode).In database i set ProjectCode as unique.
[Code]...
View 5 Replies
View Related
Jul 15, 2010
Basically, the script is an onMouseover slideshow which works fine. The problem is that in internet explorer, it says there is a syntax error relating to the javascript code. (this doesn't appear on chrome or firefox) here is the code:
Code:
<script>
<script language="JavaScript1.1">
var myimages=new Array()
var gotolink="#"
</script>
basically, by putting the script language here, IE8 is saying there is a syntax error! removing it stops the error but stops the script from working. What can I do here? If I put it in an external .js file instead (right now it is in the head of the HTML page) will this solve the problem?
View 1 Replies
View Related
May 6, 2011
I downloaded a calendar script that allows a user to just click on the date and have it populate the form input field- the problem is it lets you enter dates previous to today. I would like it so it could not enter any dates less than today.
Problem is, I know nothing about javascript. I am less than a noobie.
Would some kind soul have a look and see if it would be possible to do and show me what to do.
The code is below. There is also a css file which I did not include.
Code:
function positionInfo(object) {
var p_elm = object;
this.getElementLeft = getElementLeft;
function getElementLeft() {
[Code].....
View 3 Replies
View Related
Sep 30, 2011
I had a requirement in javascript.If I enter time as 12 it should automatically insert colon after hours and shoud allow user to enter minutes. First enter hours 12 while we are ready to insert minutes it should automatically insert colon as well as minutes.
function autoTabTimes(input, len) {
if (input.value.length == 2) {
if (input.value.indexOf(":") == -1) {
input.value = input.value + ":";
} var str = input.value.split(":");
if (str[0].length == 1) {
input.value = "0" + str[0];
}}
if (input.value.length >= len) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input) + 1)].focus();
} return true;
}
The above code is working but it is not allowing user to edit the time back space is not working.
View 1 Replies
View Related
Apr 14, 2011
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">[code]...
javascript coding portin of the web page.Need it to use the pop up alerts that have been input above and also to calculate the order upon entering a correct amount showing subtotal, tax, and total.
View 2 Replies
View Related
Jan 10, 2010
Ive got codes that calculate the route & prices between distances upon entering data into two boxes lablled "to" and "from" using google maps. What I need is the route to be shown on the map. Ive tried the googlemap forums but they wont help me (they just direct me to the documentation which I dont really understand).
Anyway after trying to read and understand the code, I managed to get the map to display but when using the form to find postcodes, it stops working.
View 5 Replies
View Related
Oct 22, 2006
I have a Java GUI application where I perform a lot of long DB operations [e.g. massive SQL Insert's], which takes 5-60 secs to perform. Sometimes user double-clicks the button or just gets impatient and clicks again, which created duplicate records.
So I am trying to disable the button as soon as it is clicked, and as soon as it's done, re-enable it again.
I tried to do it in Javascript, just simple: <input... name=Save... onclick="enabled=true;">
and as soon as screen refreshes, it re-enables the button automatically.
That works in some cases, however when I need to do some other Javascript operation
(e.g. validate() the fields on the screen), disabling the button automatically stops both Javascript and association form action in Java which is totally unacceptable.
Is there any other simple solution to such problems in Java or Javascript?
View 6 Replies
View Related