Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    1

    Some javascript isn't working in a webobject...

    I'm building a hybrid registration and software configuration tool with APMS 5.0 and part of the application needs to run off a webserver -- therefore, I'm using the WEB OBJECT to allow this to happen from within the APMS project/application.

    Ok. this javascript web page code works fine when loaded HEAD of the HTML page loaded in the web object on APMS 5.0:
    Code:
     
    function popUp(URL) {
    		day = new Date();
    		id 	= day.getTime();
    		eval("page" + id + " = window.open(URL, '" + id + "', 'titlebar=1,toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=300');");
    	}
    *However*, the following auto-tab code will not work in APMS web object -- yet it works fine in IE and Netscape...

    Code:
    var phone_field_length=0;
    function TabNext(obj,event,len,next_field) {
    	if (event == "down") {
    		phone_field_length=obj.value.length;
    		}
    	else if (event == "up") {
    		if (obj.value.length != phone_field_length) {
    			phone_field_length=obj.value.length;
    			if (phone_field_length == len) {
    				next_field.focus();
    				}
    			}
    		}
    	}
    Incidentally, this is called in the page like...
    Code:
    <input type=text name="Phone_1" size=3 maxlength=3 nKeyDown="TabNext(this,'down',3)" onKeyUp="TabNext(this,'up',3,this.form.Phone_2)">
    	-
    <input type=text name="Phone_2" size=3 maxlength=3 onKeyDown="TabNext(this,'down',3)" onKeyUp="TabNext(this,'up',3,this.form.Phone_3)">
    	-
    <input type=text name="Phone_3" size=4 maxlength=4>
    Occasionally, I even get a system message:
    "AutoPlay Application has encountered a problem and needs to close. We are sorry for the inconvenience" with all the attendant windows information...

    Any ideas?

    ~Blake

  2. #2
    Join Date
    May 2003
    Location
    Pendleton, Oregon
    Posts
    1,038
    Welcome to the Forum blake,
    I don’t want you to think you are being ignored, but I don’t have a good answer for you either. Give it another day or two and if you still haven’t received any answers, give it a ‘bump’.

    If it’s any conciliation, I spent many hours trying to overcome this same problem, I was using AMS4 at the time. I must say, at least ‘in theory’ your attempt is better than any I tried. I like that javascript.

    Unfortunately, at least according to the Help file, the Page.SetFocus doesn’t work for Web Objects. To me, the trouble seems to be that the Web Object loses focus.

    OK, here is an idea that may or may not work for you. I understand that part of your application needs to run off a webserver, but I wonder if you can take this one-step further in AMS. It appears to me that you are using this javascript on a form. Usually, the form gets ‘submitted’ to the actual script (PHP, MySQL, PERL, CGI, etc.) that needs to be on the webserver. Depending on how your particular script (webserver program) you are using, and how much control you have to tinker with it, you might be able to use AMS to build your form, and then the HTTP.Submit action, to submit the data to the actual script on the webserver, just like the form you are now using does.

    If you build your form in AMS, it’s easy to set tab order.

    Sorry I don’t have a more definitive answer for you. Perhaps someone else will.

Similar Threads

  1. Working with Tables and Files
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 12-23-2003, 08:22 AM
  2. The ? char code is not working
    By Marker0077 in forum Setup Factory 6.0
    Replies: 7
    Last Post: 06-21-2003, 04:04 PM
  3. Could someone explain FILE > EXECUTE > working directory
    By Corey in forum AutoPlay Media Studio 4.0
    Replies: 1
    Last Post: 12-12-2002, 09:13 AM
  4. Need a special Javascript PopUp window that works in AMS4
    By kpsmith in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 10-02-2002, 07:58 AM
  5. Open URL not working
    By Celeste in forum AutoPlay Menu Studio 3.0
    Replies: 4
    Last Post: 10-03-2001, 03:58 PM

Posting Permissions

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