![]() |
Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
#1
|
||||
|
||||
![]()
I know well that mysidia is anti-javascript currently, specially ajax, due to the way the pages are rendered. However, I started this and I really want to find a way.
So in my little test site for 1.3.4, I've been trying to use ajax to check if the username and e-mail already exists and tell the user real-time. I've accomplished this somewhat, but I came across two problems: 1) The function I'm using to verify the variables sent by the ajax request (for example, username and email) became a page itself (since most .php files and their respective functions are converted to html), like so http://website.com/register/checkusernamefunction. lol To avoid this (access from users to pages that shouldn't be pages), I throw an error if the variable through post is empty (if username has no value). Which is kind of not a good way to do it... Is there a way to correct this? Maybe stop the page from rendering automatically? 2) I'm doing the verification of the word I write in the input field for each key press PHP Code:
I tried using keydown and it stays behind one character for some reason (if I write "SampleAccount2" it will assume I wrote "SampleAccount", which is not as random as keypress or keyup). Instead of each key press, I thought to use it with each click on the field, but it's kinda impractical for the users, since they have to click to write the username and then click outside the input field and then click the input again to check if it's being used. I'm quite a newbie at this jquery thing, so I'm asking if these are the best ways to do it or if there are alternatives. Also another thing. My question is: is it bad practice to have the script functions displayed on the page directly instead of having them all in a single file .js? I'm echoing the javascript I need in each page since including the file didn't seem to work
__________________
![]() ![]() ![]() asp.net stole my soul. |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
jQuery - Spiffing up your page where you can't edit the HTML! | Kyttias | Tutorials and Tips | 3 | 01-29-2014 06:09 PM |
Jquery one weekend? | Tony | Other Chat | 0 | 07-30-2011 06:34 PM |
Javascript/Jquery not being run. [Answered] | exactly33 | Questions and Supports | 5 | 12-23-2009 11:39 AM |
What's New? |
What's Hot? |
What's Popular? |