Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2003
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    window.showModelessDialog()

    This has probably been asked before but can't find it so sorry if I'm double-posting.

    I'm trying to get a dialog box to pop up in circumstances where an XML link hasn't correctly populated data and ask the user to manually enter data.

    taskbrwse.htm opens the popup window NOCPrompt.htm. I want taskbrwse.htm to stop processing until the user has closed NOCPrompt.htm in a bid to pursuade the user to use the popup. Is this possible? Using this code to open the dialog:

    Code:
                        "window.showModelessDialog(~"NOCPrompt.htm?task=" + 
                        TaskID + 
                        "~",~"Enter NOC Ticket~",~"dialogHeight: 300px; dialogWidth: 300px; edge: Raised; " + 
                        "center: Yes; help: No; resizable: No; status: No;~");"
    TIA for any help.

    [edit]This only needs to work for IE 5.0+
    Last edited by Cringer; 10-13-2003 at 04:12 PM.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    You can try stoping the loading of a page till a javascript code is run and finished using a return condition, something like:

    Code:
    <head>
    <script>
    function somefunction() {
    ..
    ..
    ..
    return true;
    }
    </script>
    </head>
    
    <body onload="return somefunction();">
    I don't know if it works for onload, but I use it for onsubmit, and is OK. Try it
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New Coder
    Join Date
    Jul 2003
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for that Kor. Decided to work around the problem a bit.

    Come across a problem though with it and help would be appreciated for this too!

    when using window.showModelessDialog() I'd love to be able to submit a form on the dialog so that I can get some values out of the form and process them. Trouble is I get this error on document.forms.BrowseForm.submit();

    Object doesn't support this property or method. I've isolated to the submit() that's causing trouble. Does this mean I can't submit a modeless diablog? If so is there something similar I can use??

    TIA

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    try
    document.BrowseForm.submit();
    instead of
    document.forms.BrowseForm.submit();

    if BrowseForm is the name of the form

    if you have a singlke form use
    document.forms[0].submit();

    (that means the first form)

    the full syntax is

    document.forms[i].elements[i].method()
    or
    document.form_name.element_name.method()

    where elements or element_name can miss, if the object of the method is the form itself, not the element
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    New Coder
    Join Date
    Jul 2003
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for that, Kor. Sadly that doesn't work. I seem to think from my searches around the net the forms on Dialogs cannot be submitted which is a bit of a shame. Looks like I'll need to work around it somehow.

  • #6
    New Coder
    Join Date
    Jul 2003
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok I've got this one sorted for now. I just open up the same file in another dialog and use the GET method to push through all the data I need. Not the prettiest solution but it works fine so I'm not complaining

    Cheers for the help Kor


  •  

    Posting Permissions

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