I am fixing up a site where the address data for all the addresses for
each customer is called with 1 query and then added to a javascript
array. The street name of each shipping addresses is available in a
dropdown menu. When an address is chosen, the details are displayed
for editing in input fields under the menu.
The addresses are either US , international or military addresses.
Most of the fields are common to all types of addresses, buy each type
of address also has some unique fields. When the address is chosen, I
want only the relevant fields to display.
Option 1: The site originally had all the fields on each page no
matter which type of address was selected. Each field was made
visible or invisible as needed with javascript, but this left empty
spaces where the unused fields were.
Option 2: I could create the unique fields with ajax, and then fill
them in with data from the address array. I tried this, and it seems
like the script tries to validate the fields before they are created,
even if the validation comes after the ajax call. I don't like the
idea of using a timer, so is there any other way to have the script
wait until the ajax section is done before proceeding ?
Option 3: I could call only the address ids and street names when the
page loads, and then use ajax to call and display the address data for
each address when the user chooses it. This means a query for each
address, but that doesn't seem like a big deal.
Option 4:I could forget ajax calls entirely and use javascript to
construct and delete only the unique input fields as they are needed.
This seems javascript heavy, but it works fine and I'm leaning in this
direction.
What's the right way to do this ? 2 1324 gr*****@reenie.org wrote:
>
I am fixing up a site where the address data for all the addresses for
each customer is called with 1 query and then added to a javascript
array. The street name of each shipping addresses is available in a
dropdown menu. When an address is chosen, the details are displayed
for editing in input fields under the menu.
The addresses are either US , international or military addresses.
Most of the fields are common to all types of addresses, buy each type
of address also has some unique fields. When the address is chosen, I
want only the relevant fields to display.
Option 1: The site originally had all the fields on each page no
matter which type of address was selected. Each field was made
visible or invisible as needed with javascript, but this left empty
spaces where the unused fields were.
Option 2: I could create the unique fields with ajax, and then fill
them in with data from the address array. I tried this, and it seems
like the script tries to validate the fields before they are created,
even if the validation comes after the ajax call. I don't like the
idea of using a timer, so is there any other way to have the script
wait until the ajax section is done before proceeding ?
Option 3: I could call only the address ids and street names when the
page loads, and then use ajax to call and display the address data for
each address when the user chooses it. This means a query for each
address, but that doesn't seem like a big deal.
Option 4:I could forget ajax calls entirely and use javascript to
construct and delete only the unique input fields as they are needed.
This seems javascript heavy, but it works fine and I'm leaning in this
direction.
What's the right way to do this ?
Well, I can't say this is the right way, but wouldn't Option 1 work if
you use "display:none" to hide the irrelevant items? They wouldn't take
up space in the layout.
On Jun 12, 3:40 pm, Gary Hasler <garyhas...@thelogconnection.com>
wrote:
grou...@reenie.org wrote:
I am fixing up a site where the address data for all the addresses for
each customer is called with 1 query and then added to a javascript
array. The street name of each shipping addresses is available in a
dropdown menu. When an address is chosen, the details are displayed
for editing in input fields under the menu.
The addresses are either US , international or military addresses.
Most of the fields are common to all types of addresses, buy each type
of address also has some unique fields. When the address is chosen, I
want only the relevant fields to display.
Option 1: The site originally had all the fields on each page no
matter which type of address was selected. Each field was made
visible or invisible as needed with javascript, but this left empty
spaces where the unused fields were.
Option 2: I could create the unique fields with ajax, and then fill
them in with data from the address array. I tried this, and it seems
like the script tries to validate the fields before they are created,
even if the validation comes after the ajax call. I don't like the
idea of using a timer, so is there any other way to have the script
wait until the ajax section is done before proceeding ?
Option 3: I could call only the address ids and street names when the
page loads, and then use ajax to call and display the address data for
each address when the user chooses it. This means a query for each
address, but that doesn't seem like a big deal.
Option 4:I could forget ajax calls entirely and use javascript to
construct and delete only the unique input fields as they are needed.
This seems javascript heavy, but it works fine and I'm leaning in this
direction.
What's the right way to do this ?
Well, I can't say this is the right way, but wouldn't Option 1 work if
you use "display:none" to hide the irrelevant items? They wouldn't take
up space in the layout.
You know what? I think that is the best overall method. Thanks for the
tip!
If I had thought of that I probably wouldn't have thought of all the
other methods. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Yarco |
last post by:
I want to use "Ajax" to create my web for hobby.
But i don't know whether "Ajax" is mature...
And what about with php? Someone have experience on it?
....
|
by: bobzimuta |
last post by:
I'm creating a simple AJAX library. It's an object that will return an
array containing the response text or xml. I'm trying to find a way to
assign the response as a property of the object, but...
|
by: melledge |
last post by:
Ajax Developers' Day added to XTech 2006 agenda
XTech 2006 - 17-19 May - Hotel Grand Krasnopolsky - Amsterdam, The
Netherlands
|
by: melledge |
last post by:
Ajax Developers' Day to Kick Off XTech 2006 Conference
Industry experts offer insight into next generation of the Web
ALEXANDRIA, VIRGINIA, USA - April 25, 2006 - In response to the
rapidly...
|
by: www.web20developers.com |
last post by:
http://www.web20developers.com
http://www.web20developers.com/index.php?option=com_content&task=view...
Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell
AJAX -...
|
by: =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= |
last post by:
controlsPlease could some of you here post some of your live examples of AJAX
(esp drag panels, collapsable panels, and popup menu.)
(It's one thing to talk about how great something is, but it's...
|
by: soni2926 |
last post by:
hi,
does anyone know of any good books on ajax and asp.net, one that
teaches ajax itself before jumping in atlas? I wanted to get an
understanding of ajax and how to use it, most books i've seen...
|
by: shaunwo |
last post by:
I'm an AJAX / DOM Novice (at best) and trying to figure out how to write the value to a couple input fields. I don't remember exactly where I got the ajax.js file I'm using from (went to the website...
|
by: =?Utf-8?B?R2VyaGFyZA==?= |
last post by:
I have run into a situation that if a page/tab that uses the Ajax toolkit
(using .net version 3.5) is closed before the Ajax enable controls complete
loading, then IE locks up. Does it in both IE7...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |