Log in

View Full Version : A Javascript needed



andysam
05-12-2010, 01:10 AM
Hi All,

I am looking for a javascript which I'm not sure if is possible without Jquery.
What I want is an inline validation javascript which should do the following:

1) As I'll be using it in a form so the script will be doing the inline validation to check if the fields have the correct format of data typed in it. e.g. username, email, password, dob, phone number etc.

2) The User using the form doesnt have to go and submit the form to know that there are required fields which he needs to fill. i.e. Inline validation

3) In particular when entering the username the the user will be given a message if that username is available or not if not he will be given a few suggestions. ( I reckon there will a php backend script used for this )

I'm not sure if this is something which can be achieved but if there are some out there can anyone help me with some links or give an idea what can be done to achieve this.

Thanks

djr33
05-12-2010, 01:19 AM
Jquery is a shortcut way to do things in Javascript; it's never required, but it can certainly help make things shorter/easier.

1) Complex specified Javascript based on your requirements.

2) Same as (1)

3) That requires checking against the database through the server. Ajax and same as the rest with Javascript.


Try google-- this is not the first time someone has requested these features.


There are also some (simple) form scripts here:
http://dynamicdrive.com/dynamicindex16/index.html

Especially this one might help:
http://dynamicdrive.com/dynamicindex16/requiredcheck.htm



Additionally, for this to be at all secure you must RE-validate everything once it gets to the server using PHP, CGI, or ASP, etc.

akitodito
05-18-2010, 09:02 PM
Thank you very much for the help and assistance.

After double checking the path and making sure it was correct, I also noticed there were a few php open statements which still needed to be changed to <?php as well in order to make the screen and JavaScript to work correctly with the version of PHP being used on the server.

Beverleyh
05-19-2010, 07:26 AM
I like to use this one: http://www.benjaminkeen.com/software/rsv/jquery/demo.php

And also this: http://livevalidation.com/

djr33
05-19-2010, 05:10 PM
Additionally, for this to be at all secure you must RE-validate everything once it gets to the server using PHP, CGI, or ASP, etc.
If your response was related to this, note that I did not mean validate the html of the page: I am talking about the information submitted.
Javascript can be faked by the user, so you will need a server side script (like PHP) that will recheck the submitted information to be sure that someone didn't ignore/trick/disable the javascript check on the page.