473,779 Members | 2,062 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hidden data - best practice, best way, suggestions

I have two sets of text strings. They are related to each other and
are not proprietary. X group contains about 2000 short, one to three
word, strings. Y contains about 50. These two groups supply the
option items in two select boxes. Box Y scopes the items allowed in
select box X. As selections in Y are made, optional items in X
change.

I’ve never hidden so much data before and wondered if there is a best
way to do this. I intended to create a string, comma delimited, of X
Y pairs, and when the information is required for use, split it and
either consider the data immediately or park it in an array for a next
process step.

Call backs to the server have been considered and rejected. The data
must accompany the page.

Thanks.
Sep 10 '08 #1
1 1293
On Wed, 10 Sep 2008 12:29:49 -0700, oldyork90 wrote:
I have two sets of text strings. They are related to each other and are
not proprietary. X group contains about 2000 short, one to three word,
strings. Y contains about 50. These two groups supply the option items
in two select boxes. Box Y scopes the items allowed in select box X.
As selections in Y are made, optional items in X change.

I’ve never hidden so much data before and wondered if there is a best
way to do this. I intended to create a string, comma delimited, of X Y
pairs, and when the information is required for use, split it and either
consider the data immediately or park it in an array for a next process
step.

Call backs to the server have been considered and rejected. The data
must accompany the page.

Thanks.
From your description, look at storing your data in an object, rather
than multiple arrays. (Objects, in Javascript, are very similar
associative arrays in other languages, though there are some difference.)

/* Untested syntax */

var myObject = {
"car" : ["ford", "chevy", "vw"],
"boat" : ["rowboat"]
}

To access the members, you would do something like:
for (key in myObject) {
if myObject.hasOwn Property(key) {
alert(key);
}
}

Will alert "car" and "boat"

To look at the options for car and boat, I would do:
key = "car";
var myArray = myObject[key];

for (var i = 0; i < myArray.length; i++) {
alert(myArray[i]);
}

If this data is fairly static, make it an .js file and script it in to
your page to take advantage of caching.
Sep 10 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
11302
by: Andrew Durstewitz | last post by:
Hi! I am having a really strange issue. I have a few users calling in saying they are getting an error. On further review I found this line is what is causing it... Set strLookup = cnAddStep.Execute ("SELECT * FROM ActionSteps WHERE planId = '" & intPlanId & "' ORDER BY stepId DESC") The exact peice causing it is intPlanId. For some reason the form
1
3105
by: James E | last post by:
I have a question about best practices of how to deal with lookup data from my C# apps. On a couple of occasions I have come across a problem where I have to automate inserting a record into a table that has a foreign key constraint that is linked to a lookup table. E.g. Take the following database structure: SQL-Server Database: Table 1:
136
9457
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to use. The above URL is version 1.0 (draft) that resulted. IMO, it is not a replacement for the FAQ,...
2
2240
by: Duncan Welch | last post by:
I'm working with 4 websites running on the same box with seperate IIS sites (I can't change this) - 3 that display information from a database, and one that collects it and writes to the same database. They all use the same DLL as a data layer, which also does database caching using the Application object. The first problem I have is I have 4 instances of the DLL which dont talk to each other, so all information is stored 4 times, and I...
4
11718
by: WB | last post by:
Hi, I need to validate a hidden input in my webform to ensure that it's got value. The controls look something like this: <input id="HidSelectedStates" type="hidden" runat="server" /><br /><br /> <asp:Button ID="BtnSubmit" runat="server" OnClick="BtnSubmit_Click" Text="Submit" ValidationGroup="submitStates" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator1"
19
3842
by: Badr.ALmuzini | last post by:
hi,there how can i make php file extension hidden in the URL somthing like this (http://mail.google.com/mail/?view) Regard....
3
4965
by: Furty | last post by:
Hi, I'm looking for the best practice for creating a generic data validation implementation for my data bound business objects. I currently have a business object base class implementing the following interfaces: IEditableObject, ICloneable, INotifyPropertyChanged, and IDataErrorInfo More specifically, my IDataErrorInfo implementation is like so:
4
7254
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which - "Modified" of type DateTime - is hidden since it should not be edited by a user. The system handles the update for this column. So, I have hidden (Visible=false) this column on the grid. In order to access the value in this field, I have created a...
9
6256
by: =?Utf-8?B?QW1tZXI=?= | last post by:
I've read many incomplete opinions about the "Best Practice" for securely accessing SQL but what I really need to find the "Best Practice" that fits my applications needs. Currently (alpha stage) I am Using a .Net DSN-Less SQLConnection method in my client program (vb.net) and sending uid/pwd across the network. The client only calls upon the stored procedures to access the tables in SQL 2005. This is a semi commercial application...
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9930
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.