Results 1 to 9 of 9

Thread: tooltip with forms in php?

  1. #1

    tooltip with forms in php?

    I don't really want to use javascript.
    What I want to do is to have a descriptive tooltip displayed
    when I user clicks a form field.



    When the user clicks the input box, the text "Enter your name" is displayed or something similar to that effect.
    and so on for the others.
    Last edited by Utech22; September 28th, 2008 at 01:17 PM. Reason: js

  2. #2
    has to be javascript
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

  3. #3
    I use CSS on a few apps at work by using the basic CSS rollovers with the silk "help" icon, usually looks pretty nice, but for what you want simp is right has to be JS.

    Join #kirupa | Click the under my Username | CL | Jeff

  4. #4
    Quote Originally Posted by simplistik View Post
    has to be javascript
    What I was pseudocoding was:

    PHP Code:
    $message_name "Enter your name"
    HTML Code:
    <input type="text" name="name" onclick="<?php echo $message_name;?> />
    Or something similar.

  5. #5
    ^onclick is a javascript event handler and doesn't work like how your using it.

    Join #kirupa | Click the under my Username | CL | Jeff

  6. #6
    What you are looking for is onfocus, something like this can be easily achieved using javascript. I use it on http://www.websiteninjas.com/contact-us

    You can still the javascript and css file if you would like.

  7. #7
    Quote Originally Posted by ajcates View Post
    .................... http://www.websiteninjas.com/contact-us
    .....................
    Your validation is not working, I just test it in IE6.

  8. #8
    155
    posts
    Registered User
    use the title attribute if you want a tooltip to appear near the mouse. (like hovering over the title of a thread on this forum)

    or you can use css popups if you want it to appear as part of the page. http://meyerweb.com/eric/css/edge/popups/demo.html

  9. #9
    if for some reason you wanted the variables for your messages to be php values, you can always go a javascript/json route. you have your json encoded array in some sort of storage file, so like
    Code:
    $messages = array(
    'first_name' => "Please enter your first name.",
    'last_name' => "Please enter your last name."
    );
    then with javascript import that data via json and it could dynamically show that tooltip.
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012