Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

61 users online



Check every character in all text boxes onSubmit

Check every character in all text boxes onSubmit

Currently viewing this thread: 1 (0 members and 1 guests)


alsaffar

alsaffar

Neverside Newbie
Status: Offline!

Check every character in all text boxes onSubmit

Hi there,

I have one question, how can we onSubmit form action check all fields values if they contain a specific charatcer (in regardless what is the field name or how many fields, they might be only a text box).

Lets say i want to raise an alert and stop the form from being submited if on of the text boxes have the character '~' or '`' or '|' etc..

I managed to make a function to check while the user is typing, but they can copy any text from a notepad then paste it in the text box! So because of this I want to make another check onSubmit.

Thanks in advance Smile

vek

vek

die();
Status: Offline!
Code:


<form name="myform" ..... onsubmit="validate();">

function validate()
{
if(!illegal_chars())//validate all the fields....if okay, submit
{
document.forms["myform"].submit();
}
else
{
alert("Wrong!!!!");
}
}

___________________

--Life would make more sense if I had the source code--

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0159 seconds.