Hi Mike,

Did you check with Dan Switzer? Does he have a yahoo group for the
gateway as he does for qForms?

Dan

----- Original Message -----
From: Tangorre, Michael <[EMAIL PROTECTED]>
Date: Tue, 21 Sep 2004 17:31:37 -0400
Subject: OT: JS Gateway Question
To: CF-Talk <[EMAIL PROTECTED]>

I am still in search of a solution to a problem I had a few weeks back.
This is OT for the CF list, but I am hoping someone here has used the JS
Gateway from www.pengoworks.com.

I have a form with a bunch of select boxes on it that I use qForms to
populate, etc (from a DB.. use ColdFusion to loop etc...). I also use
the JS Gateway for two of the select boxes; lets call them "A" and "B".
When the page initially loads everything works fine.. "A" populates fine
and when a user selects something in "A", "B" populates fine (using
Gateway). The issue I have is that when the user comes back into the
form after saving the form, how can I get "A" and "B" populated since
they rely on the Gateway for initial population as well as obtaining the
values for "B" from "A"?

I have tried everything from setting the value for the "A" select after
the loadOptions() method loads the options etc, but I keep finding
myself in this infinite loop or getting out of memory errors etc. Do you
know how I could accomplish getting "A" populated and set with the value
from the DB then get "B" set based on "A", finally setting the value of
"B" set with the value from that comes from the DB (if there is one of
course). I have come back to this problem many times, always failing to
find a solution.

Anyone using the Gateway and have some suggestions? In case it helps,
the following are the Gateway functions that are used:

Thanks!

-Mike

// Gateway Init() function
function init(){
objGateway.> document.basicDataForm.strAgency.length = 1;
document.basicDataForm.strBureau.length = 1;
loadOptions("strAgency");
}

// Gateway populate() function
function populate(f, a){
var oField = document.basicDataForm[f];
oField.options.length = 0;
for( var i=0; i < a.length; i++ ) oField.options[oField.options.length]
= new Option(a[i][0], a[i][1]);
}

// Gateway loadOptions() function
function loadOptions(f){
var d = {}, oForm = document.basicDataForm;
if( f == "strAgency" ){
   document.basicDataForm.strAgency.length = 1;
}
var sAgency =
oForm.strAgency.options[oForm.strAgency.options.selectedIndex].value;
displayLoadMsg(f);
objGateway.sendPacket({field: f, strAgency: sAgency});
}

// Gateway updateOptins() function
function updateOptions(){
if( this.received == null ) return false;
populate(this.received[0], this.received[1]);
return true;
}

// Gatewaye displayLoadMsg() function
function displayLoadMsg(f){
var oField = document.basicDataForm[f];
oField.options.length = 0;
oField.options[oField.options.length] = new Option("Loading data...",
"");
}

// Create the gateway object
objGateway.create();

// Initialize the gateway object
init();________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to