SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error in IE: return statement outside of function

    Hi,

    i'm a beginner to java script. can anyone help me in this with this.

    if iam the user i want to insert a username in the textbox and it check whether it exist (i can do this in php code) or not..if the username exist it focus on the
    username textbox.

    Can anyone give me an idea.Thanks a lot..

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,681
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ryoka012 View Post
    Hi,

    i'm a beginner to java script. can anyone help me in this with this.

    if iam the user i want to insert a username in the textbox and it check whether it exist (i can do this in php code) or not..if the username exist it focus on the
    username textbox.

    Can anyone give me an idea.Thanks a lot..
    There's a problem that us JavaScript authors face that you may not be aware of, and that is that we need to ensure that things keep working even when JavaScript is not available.

    To achieve that, you start from the very bedrock basics. A form submits to a php page, and that php page performs the checks, and updates the page.

    Once those basics are in place, you can extract the part that performs the checks to a separate file so that it can be included, and also so that you can send an AJAX request to that same file.

    The book Bulletproof Ajax is the best one for learning how to do what you want to achieve. The web site also provides all of the code and working examples too, of which the Contact Us example from Chapter 6 is a fully working example of the type of technique you wish to use.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •