Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    2 little modified

    This project contain a similar Db to maintain a user profile.
    http://www.gssitaly.com/firme_11032005.zip

    i have a problem:

    1) if you click from the Home page on the linki GESTIONE appear a popup to permit the user to add new record. All work, but after i have presse the button INSERISCI the record is added but the script not return the initial menu to add a new record. The page after pressing INSERISCI is withe?!

    2) I possible to insert this condition in the popup ADDRECORD.ASP:
    If you insert a MATRICOLA and if this MATRICOLA is already existis make appear a Msg Box "already existis the matricola ....." . The same condition in the box SPORTELLO

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: 2 little modified

    #1) Your page addrecord.asp contains no HTML code to display to the user. It has ASP code that runs on the server, but nothing written to the page sent to the user. That is why the user sees a blank page in the pop-up window.

    You can add a message to the user using Response.Write "

    Your record was added to the database.</p>" , or any other message that you like, inside your ASP script tags (between <% and %>).

    You also could write JavaScript code that would close the window automatically, or to prompt the user to close the window. Here is some code I have used in the past for the second method:
    1. <LI>This part goes in the page header, before the ASP script tags (or you could output this with Response.Write if you prefer):
      <hr><pre><script>
      function closeDialog(strRefresh)
      {
      if (strRefresh == "Y")
      {
      // Refresh the calling page
      window.opener.location.reload();
      }
      // Close this window
      window.close();
      }
      </script></pre>

      <hr>
      <LI>This part goes at the end of your ASP script:
      <hr><pre>Response.Write "

      <a href=""java script:closeDialog('Y');"">Click
      here to close this dialog</a></p>" & vbCrLf</pre>

      <hr>
    The "Y" parameter forces a reload of the original page that created the pop-up window. That way, if your original page was displaying all the records in the database for a particular query, it will re-query and show the new information. I have used this with GET requests, but POST requests may prompt the user before the screen is redisplayed. Hopefully that will not be too confusing. If it is too confusing, you can leave the parameter blank or change it to N to leave the original window as it was.

    #2) That is possible. You need to query your database and, if the result is not .EOF (end of file, a blank recordset), then report an error, otherwise run your existing code to add the record. I didn't look at your database, but I suspect that the query would be similar to your original search code in your search page.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 2 little modified

    Good all is solved with you. Tks.
    But for you is possible to insert a little button/icon in a new column before MATR, if this is clicked show all data in a new popup with a tipical button YES NO?
    If YES delete entire record, if No return to the list.
    Tks.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: 2 little modified

    Yes, I think that is possible, but I can't develop ASP code right now (because the only ASP server I have is a live production server). Sorry!

Posting Permissions

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