#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    2

    [Solved] Javascript simple popup form


    I have a page with multiple items generated by php. There is a button for the user to add notes to a record which does a window.open to a little popup to add notes.

    On this notes page the form submits back to the parent parent page and the window closes.

    Everything works great EXCEPT that once the user has submitted for that particular record, Javascript will not open the popoup again. Here is what is really weird, it won't open again on any machine. Ohh, and giving each window the same name for each record makes no difference.

    So obviously it's something else I can't figure it out.
    Also, for those that recommend a modal, the parent page is a "feed" and refreshes every 30 seconds so any form must be separated from it.

    Name the parent page:
    window.name='pd';

    Link from parent page to popup:
    Code:
    <a href='#'  onclick=\"window.open('customernotes.php?lead_id=$lid&fname=$fname&lname=$lname&cusstatus=$cusstatus&id=$id&cusnotes=$cusnotes','win$lid','width=400,height=300,resizeable=no,menubar=no,scrollbars=no,addressbar=no');\" class='eeditnotes'  style='font-size:11px;font-weight:bold;color:white;'>Edit my notes</a>
    Form on edit page to submit back to parent page:
    Code:
    form method=POST action='productdisplay.php?id=$id' target='pd' onSubmit='window.close();'>
    Remember, this all works perfectly except when you click the button a second time for only that particular record no pop-up window comes up. All records do.

    Go easy on me, I barely know javascript just getting my feet wet in it.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    2

    Cancel That


    Coffee kicked in. Realized I hadn't encoded my URL's. Punctuation causing problems.

    Sorry guys.

    Proceed.
  4. #3
  5. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,124
    Rep Power
    4303
    Congratulations on figuring it out and thanks for telling us what the solution was.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo