2 quick programming questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • clickhappy
    Confirmed User
    • Mar 2004
    • 4027

    #1

    2 quick programming questions

    I have a site with a login form. Its just a user name and password to log in.

    1. How do I set the focus of the cursor on the username?
    So when the page loads the cursor goes right in the username text box?

    2. How do I have the form pre filled with the members username and password from last time?
    So when they come to my site the curser is in the box, the username and password are already intered, and all they need to do is hit "enter" and they log in?

    Do I need a cookie? I have no idea how to make a cookie.
    Last edited by clickhappy; 09-08-2008, 10:42 AM.
  • mrkris
    Confirmed User
    • May 2005
    • 2737

    #2
    1. Javascript: document.formname.fieldname.focus();
    2. Leave this to the browser with the "remember username/password" support.

    PHP-MySQL-Rails | ICQ: 342500546

    Comment

    • clickhappy
      Confirmed User
      • Mar 2004
      • 4027

      #3
      Originally posted by mrkris
      1. Javascript: document.formname.fieldname.focus();
      2. Leave this to the browser with the "remember username/password" support.
      Ill try that now, thanks very much

      Comment

      • k0nr4d
        Confirmed User
        • Aug 2006
        • 9231

        #4
        Originally posted by clickhappy
        Do I need a cookie? I have no idea how to make a cookie.
        Ingredients

        • 3/4 cup sugar
        • 3/4 cup packed brown sugar
        • 1 cup butter
        • 1 large egg
        • 2 1/4 cups all-purpose flour
        • 1 teaspoon baking soda
        • 1/2 teaspoon salt
        • 2 cups semisweet chocolate chips
        • if desired, 1 cup chopped pecans

        Directions

        Preheat oven to 375 degrees. Mix sugar, brown sugar, butter and egg in a large bowl by hand. Stir in flour, baking soda, and salt. The dough will be very stiff. Stir in chocolate chips. Drop dough by rounded tablespoonfuls 2 inches apart onto ungreased cookie sheet. Bake 8 to 10 minutes or until light brown. The centers will be soft. Let cool for one minute then remove from cookie sheet and place on wire rack to finish cooling.

        ---------
        OR
        ---------
        http://www.php.net/setcookie
        Mechanical Bunny Media
        Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

        Comment

        Working...