Popups or callouts for simple data entry

Discussion in 'Javascript' started by bjhess@gmail.com, Sep 6, 2006.

  1. Guest

    I am working on an application that includes a screen with a list of
    people on the right and a list of groups they can be involved in on the
    left. The user can drag-and-drop people from the right to groups on
    the left and visa-versa.

    I would like to be able to have a quick way for the user to add a new
    person in the right-hand list. Preferrably the user could click a
    "new" link, a popup or callout would appear and user could enter the
    person's name and contact info, click "save" and never leave the screen
    through all this. I'm not too concerned about the AJAX code to
    dynamically update the list of people - I'll be using prototype.js for
    that.

    I'm simply looking for a primer on creating that callout code. Does
    anyone know of a good starting place?

    Thanks,

    Barry
    , Sep 6, 2006
    #1
    1. Advertising

  2. ASM Guest

    a écrit :
    > I would like to be able to have a quick way for the user to add a new
    > person in the right-hand list. Preferrably the user could click a
    > "new" link, a popup or callout would appear and user could enter the
    > person's name and contact info, click "save" and never leave the screen
    > through all this.


    JS :
    function showNew() {
    var n = document.forms['new'].style;
    n.display = n.display==''? 'block' : '';
    }
    function saveNewMember(Form) {
    var memberName = Form.name.value;
    var memberContact = Form.contact.value;
    // job to add to list(s)
    showNew(); // hidde adding form
    }

    HTML :
    <a href="#" onclick="showNew();return false;">Add member</a>
    <form
    name="new"
    style="display:none"
    onsubmit="saveNewMember(this);return false;">
    <p>Name <input name="name">
    <p>Contact <input name="contact">
    <p>input type=submit value="Add">
    </form>

    --
    Stephane Moriaux et son [moins] vieux Mac
    ASM, Sep 6, 2006
    #2
    1. Advertising

  3. Guest

    Thanks for the reply. This did work for the most part (change noted
    below). However, I'd also like to create a version where a callout
    appears as a layer above the rest of the page rather than inline with
    the page. Does anyone have another tip for that type of situation?

    Thanks.


    ASM wrote:

    > JS :
    > function showNew() {
    > var n = document.forms['new'].style;
    > n.display = n.display==''? 'block' : '';
    > }


    I changed that last line to:

    n.display = n.display=='none' ? 'block' : 'none';
    , Sep 7, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AtomicBob
    Replies:
    14
    Views:
    856
    Toby Inkster
    May 2, 2006
  2. Carlos
    Replies:
    1
    Views:
    605
    Paul McGuire
    Jan 22, 2006
  3. Moe Sisko
    Replies:
    1
    Views:
    833
    George
    Aug 4, 2008
  4. Mike Owen

    Allowing entry of a Carriage Return during data entry

    Mike Owen, Jul 27, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    679
    Alessandro Zifiglio
    Jul 27, 2006
  5. Noozer
    Replies:
    2
    Views:
    237
    Dr John Stockton
    Aug 1, 2005
Loading...

Share This Page