Get a Jumpstart with our Sample Apps
Results 1 to 4 of 4

Thread: Dialog "Initial Focus"

  1. #1
    "Certified" Alphaholic
    Real Name
    Louis Nickerson
    Join Date
    Aug 2002
    Posts
    1,039

    Default Dialog "Initial Focus"

    Hello,

    I have a dialog component on an a5w page.

    I would like to set the "Initial Focus" to a specicfic field (much like you can do in X-Dialog), so that when the user navigates to the page, the cursor will already be placed in the first field of the dialog.

    Is this possible and if so, how is it accomplished?

    Thanks

    Louis

  2. #2
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,608

    Default RE: Dialog

    You can add Javascript to your A5W page to move the focus to the field you'd like to start at. Switch to the Source view in the HTML editor and modify the "body" tag to include something like

    "body onLoad="document.form.field.focus();""

    In the above, you'll also need to change "form" and "dield" to the names of your form and field

    -Lenny

  3. #3
    "Certified" Alphaholic
    Real Name
    Louis Nickerson
    Join Date
    Aug 2002
    Posts
    1,039

    Default RE: Dialog

    Lenny,

    Thank you!

    Louis

  4. #4
    Member
    Real Name
    Jack Lim
    Join Date
    Jun 2005
    Posts
    218

    Default Re: Dialog "Initial Focus"

    Hi

    Please advice where to add the code to set focus:

    My form name is = Party_Information
    Focus Field Name = Party_Code

    This is my Script:
    HTML Code:
    <html>
    <head>
    
    <%a5
    Delete tmpl_Customer_Dialog
    DIM tmpl_Customer_Dialog as P
    tmpl_Customer_Dialog = a5w_load_component("Customer_Dialog")
    'Following code allows you to override settings in the saved component, and specify the component alias (componentName property).
    'Tip: Keep the componentName property short because this name is used in page URLs, and it will help keep the URLs short.
    'Each component on a page must have a unique alias (componentName property).
    with tmpl_Customer_Dialog
    	componentName = "Customer_Dialog"
    end with 
    '=======================================compute the HTML for the Component=======================================
    delete x_Customer_Dialog
    dim x_Customer_Dialog as p
    x_Customer_Dialog = a5w_run_Component(tmpl_Customer_Dialog)
    '=============================================================================================================
    if x_Customer_Dialog.RedirectURL <> "" then 
    	response.redirect(x_Customer_Dialog.redirectURL)
    	end
    end if 
    ?x_Customer_Dialog.Output.Head.JavaScript
    ?x_Customer_Dialog.Output.Head.CSS_Link
    %>
    <!--Alpha Five Temporary Code Start - Will be automatically removed when page is published -->
    <!--CSS for tmpl_Customer_Dialog -->
    <link rel="stylesheet" type="text/css" href="file:///C:/Program Files/A5V8/css/Corporate/style.css">
    <!--Alpha Five Temporary Code End -->
    
    <meta name="generator" content="Alpha Five HTML Editor Version 8 Build 1680-3089">
    <title></title>
    </head>
    <body class="CorporatePageBODY">
    
    <p><br>
    <table>
    	<tr>
    		<td><%A5 ?x_Customer_Dialog.Output.Body.Dialog_Echo %></td>
    	</tr>
    	<tr>
    		<td><%A5 ?x_Customer_Dialog.Output.Body.Xbasic_Code_Errors %></td>
    	</tr>
    	<tr>
    		<td><%A5 ?x_Customer_Dialog.Output.Body.Dialog_HTML %></td>
    	</tr>
    </table><
     /p>
    </body></html>
    Last edited by AaronBBrown; 07-06-2007 at 02:10 PM. Reason: added [html][/html] tags
    Many Thanks.

    Jack Lim

Similar Threads

  1. "Setting Security" dialog box not closed
    By mronck in forum Alpha Five Version 7
    Replies: 0
    Last Post: 10-12-2005, 06:49 AM
  2. Form.view (formname'"Dialog") leaves fil
    By Mike Thomson in forum Alpha Five Version 6
    Replies: 4
    Last Post: 08-05-2005, 03:28 PM
  3. Dialog "Cancel" Button does not stop scr
    By Hoyt in forum Alpha Five Version 5
    Replies: 1
    Last Post: 11-27-2004, 02:07 AM
  4. Dialog box: "Now Printing XXX Report"?
    By David Farr in forum Alpha Five Version 5
    Replies: 8
    Last Post: 08-10-2003, 03:40 PM
  5. Order of files in "Open database" dialog
    By Jim Cooper in forum Alpha Five Version 4
    Replies: 2
    Last Post: 12-06-2001, 05:35 AM

Posting Permissions

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