BRF : Looping through a table (e.g. Do Until or While, etc..)
Hello Colleagues,
In BRFPLus I understand we can create Loop Expressions that allow you to loop through a table and perform different Actions based on the retrieved contents of the table.
We are not using BRFPLus (but the old BRF instead). Does anyone know how to build Loop Expressions in BRF without the use of ABAP Function Modules?
Your feedback would be really appreciated.
Thanks in advance.
Regards,
Ivor M.
Hello Colleagues,
In BRFPLus I understand we can create Loop Expressions that allow you to loop through a table and perform different Actions based on the retrieved contents of the table.
We are not using BRFPLus (but the old BRF instead). Does anyone know how to build Loop Expressions in BRF without the use of ABAP Function Modules?
Your feedback would be really appreciated.
Thanks in advance.
Regards,
Ivor M.
Similar Messages
-
I need to loop through 1 table and read another until a value changes
i need to read a table and sum the quantity field until a reason code changes. how do I go about doing this?
sort itab by reasoncode.
Loop at itab.
quantiy = quanity + itab-quantity.
at end of reasoncode.
jtab-reasoncode = itab-reasoncodee.
jtab-sum = quantity.
append jtab.
clear quantity.
endat
endloop.
or
sort itab by reasoncode.
loop at itab.
at end of reasoncode.
sum.
jtab = itab.
append jtab.
endat.
endloop.
or
let us say itab and jtab are two tables and you want to loop through itab and read jtab for reasoncodes.
if jtab has only one entry for each entry in itab then use read else use loop.
loop at itab.
loop at jtab where reasoncode = itab-reasoncode.
quantiy = quantiy + jtab-quanity.
endloop.
endloop.
or
loop at itab.
read table jtab with key reasoncode = itab-reasoncode.
if sy-subrc eq 0.
endif
endloop. -
Is it feasible to write code that loops through a table in a form? I'm currently writing separate sections of code for each row of a five-row table to validate data entries.
Hi,
It would be easier if your table contained one row that repeated with an initial count of five (this is set in the binding tab of the Object palette). This will change the XML generated but assuming that is not a problem your could loop though your table with the code;
var rows = this.resolveNodes("Table1.Row1[*]");
for (var i=0; i<rows.length; i++)
var currentRow = rows.item(i);
If you do need the rows uniquely named then you could pass i and the result of "this.resolveNodes("Table1.Row"+i)" into a function.
This is you form back ... with only the first validation converted to the new approach.
https://acrobat.com/#d=akb0*Ptvdr3KSYN0VP*7zA
Hope this gets you started.
Regards
Bruce -
how do I loop through the following table and get it to insert records into another depending on the number that it finds in the value column. eg if there is 8 in the value column, 8 records should be inserted into another table with the same ID
i forgot to paste an example table
ID
Name
Value
1
john
12
2
sarah
20
3
Tom
5
I want it to look at the value column and if it is 12 it should add 12 rows with the same ID into another table. eg in the new table there will be 12 rows for John with an ID of 1. For Sarah there will be 20 rows with an ID of 2.
sukaiSure!
DECLARE @sourceTable TABLE (ID INT, Name VARCHAR(20), Value INT)
INSERT INTO @sourceTable (ID, Name, Value) VALUES (1, 'john', 12),(2, 'sarah', 20),(3, 'Tom', 5)
This mocks up your source table (where your data is coming from). We're simply creating a table variable, and populating it with your example data.
DECLARE @numbers TABLE (value INT)
WHILE (SELECT COUNT(*) FROM @numbers) < (SELECT MAX(Value) FROM @sourceTable)
BEGIN
INSERT INTO @numbers (value) VALUES ((SELECT COUNT(*) FROM @numbers)+1)
END
This creates an example numbers table. The while causes the code to loop until there are as many rows as the maximum value for the Value column in your example data. Each time the loop iterates it inserts a row, causing the COUNT(*) to be one more each time,
we add one to that, and insert it into the numbers table.
INSERT INTO destinationTable
SELECT s.ID, s.Name, s.Value
FROM @sourceTable s
INNER JOIN @numbers n
ON s.Value >= n.value
ORDER BY s.ID
This performs an insert select to a made up table. We join the rows from @sourceTable (your example data) to the @numbers table where the Value column from @sourceTable is less than or equal to the value column in the numbers table. If s.Value is 1
we'll perform this join once. If it's 2, twice and so on. This works because of the way we set up the numbers table. If we had insert multiple 1's it would cause additional joins.
A numbers table is a handy tool to have for things like this were you need iterations. Create a database (or schema) on your database and call it something like 'Toolbox'. In that database/schema you can put things like this that have little to do with your
actual data, but come in handy. You can make your numbers table as long as you need. It totally wouldn't hurt at all to have a numbers table with hundreds of thousands of rows. They're just int's, they don't eat much :).
Let me know if you'd like anything clarified more. -
Error "Screen output are too small" when looping through internal table!
Hello All:
I have a huge internal table with some 79000 records and while looping through them and doing some other processing inside the loop, I am getting an error "Screen output are too small"! Could someone please help mw how to fix this issue? I can send the all the code if anyone wants to look at the code. Thanks in advance and rewards are assured.
MithunHi,
Check this
new-page print off.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
destination = v_dest
IMPORTING
out_parameters = params
valid = valid.
* params-linct = '58'.
* params-linsz = '170'.
* params-paart = 'X_58_170'.
* params-prtxt = v_spool_text.
* params-primm = 'X'.
* params-prrel = 'X'.
NEW-PAGE PRINT ON PARAMETERS params NO DIALOG.
After the call fm GET_PRINT_PARAMETERS params internal table contains all the values for generating spool.
aRs -
Looping through a month to count the number of Mondays etc
Can someone give me some pointers about where I'm going wrong here please? (No, this isn't a homework but I am trying to solve something). I want to be able to loop through the days in the previous month to find out how many Mondays, Tuesdays etc so that I can work out something else. Yes, I have read all the API information about Calendar,GregorianCalendar etc and I have a mental block about loops and the answer is probably very simple so please be gentle!
import java.util.Date;
import java.util.*;
import java.text.*;
class Dates
public static void main (String [] args)
int i;
int mondayCount;
int daysInMonth;
DateFormat reportDateFormat = new SimpleDateFormat("EEEE dd.MMM.yyyy");
Calendar theDay = Calendar.getInstance();
theDay.add(Calendar.MONTH,-1);
daysInMonth=theDay.getActualMaximum(theDay.DAY_OF_MONTH);
int today = theDay.get(Calendar.DAY_OF_MONTH);
int dayOfWeek = theDay.get(Calendar.DAY_OF_WEEK);
mondayCount=0;
for (i=0;i<daysInMonth;i++)
if(today==Calendar.MONDAY)
mondayCount++;
System.out.println("Testing "+mondayCount);
System.out.println("Day of Week"+ dayOfWeek);
System.out.println("Days in month" +daysInMonth);
System.out.println("Today" + today);
System.out.println("theDay"+ theDay);
I can find out how many days are in the previous month( I think!) and what the code is for today- but what am I not getting here? My loop just gives 0 31 times.
Any constructive help would be much appreciated.you were never actually updating the day of the month.... check out the updated code below....
import java.util.Date;
import java.util.*;
import java.text.*;
class tester
public static void main (String [] args)
int i;
int mondayCount;
int daysInMonth;
DateFormat reportDateFormat = new SimpleDateFormat("EEEE dd.MMM.yyyy");
Calendar theDay = Calendar.getInstance();
theDay.add(Calendar.MONTH,-1);
daysInMonth=theDay.getActualMaximum(theDay.DAY_OF_MONTH);
int today = theDay.get(Calendar.DAY_OF_MONTH);
int dayOfWeek = theDay.get(Calendar.DAY_OF_WEEK);
mondayCount=0;
theDay.set(Calendar.DAY_OF_MONTH, 1); // set the date to the 1st of the month
for(i=1;i<=daysInMonth;i++) {
if(theDay.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
mondayCount++;
theDay.add(Calendar.DAY_OF_MONTH, 1);
System.out.println("Monday count = " + mondayCount);
} -
Hi All,
I'm new to Powershell and recently wrote a script that used the system.directoryServices class to bind to Active directory and pull out a bunch of info I need. Problem is that once I have this stuff, I have it in a hash table and I can't seem to pull
out just the pertinent info. As you can see from the pic below, I have a bunch of blank fields....and when I wrote a for to cycle through these and ignore the $null values...i just got back a bunch of system.collectionhashtable system.collectionhashtable system.collectionhashtable...over
and over again. I was hoping someone could help me get out the values I need...do I need to convert this hash table into some other sort of object to work with it? I'm not to sure were I've gone wrong.
This is what I started with to produce the below:
$objDomain = new-object system.directoryServices.directoryEntry
$strTopDomain = $objDomain.distinguishedName
$strTopLDAP = "LDAP://OU=Something,OU=else,OU=other,$strTopDomain"
$objTopOU = new-object system.directoryServices.directoryEntry("$strTopLDAP")
$strTopOU = $objTopOU.distinguishedName
$topFilter = "(&(computerlink=*)(iwstemplatelink=*))"
$topObjSearcher = New-Object System.DirectoryServices.DirectorySearcher($topFilter)
$topObjSearcher.searchRoot = $objTopOU
$topObjSearcher.searchScope = "subtree"
$topObjSearcher.propertiesToLoad.add("computerlink")
$topObjSearcher.propertiesToLoad.add("iwstemplatelink")
$topObjSearcher.propertiesToLoad.add("vpslocation")
$objTopList = $topObjSearcher.findAll()| foreach-object { @{n='Name';e={$_.vpslocation}}, @{n='Value';e={$_.iwstemplatelink}}}
Then I tried a while loop...something along these lines:
$x = 0
$y= $objTopList.count()
while ($x -lt $y){
if($objTopList -ne $null){
write-host $objTopList[$x]
x++
But as I said above....I just got the Sytems.collections repeated over and over. Any help would be appreciated. Really not much of a scripting guy. ThanksWhy are some people bent on being so annoying.
Here is how to unwind the property wrappers on the searchresults collection of searchresult objects.
$objDomain = new-object system.directoryServices.directoryEntry
$strTopDomain = $objDomain.distinguishedName
$strTopLDAP = "LDAP://OU=Something,OU=else,OU=other,$strTopDomain"
$objTopOU = new-object system.directoryServices.directoryEntry("$strTopLDAP")
$strTopOU = $objTopOU.distinguishedName
$topFilter = "(&(computerlink=*)(iwstemplatelink=*))"
$topObjSearcher = New-Object System.DirectoryServices.DirectorySearcher($topFilter)
$topObjSearcher.searchRoot = $objTopOU
$topObjSearcher.searchScope = "subtree"
$topObjSearcher.propertiesToLoad.add("name")
$topObjSearcher.propertiesToLoad.add("samaccountname")
$topObjSearcher.propertiesToLoad.add("computerlink")
$topObjSearcher.propertiesToLoad.add("iwstemplatelink")
$topObjSearcher.propertiesToLoad.add("vpslocation")
$objTopList = $topObjSearcher.findAll()|
foreach-object {
$p=@{
Name=$_.Properties['name'][0]
SamAccountName=$_.Properties['samaccountname'][0]
VPSLocation=$_.Properties['vpslocation'][0]
LWSTemplateLink=$_.Properties['iwstemplatelink'][0]
New-Object PsObject -Property $p
We must use the "Properties" collection as the properties loaded are NOT exposed on the object. THey are also all included as elements of a collection so we need to use the [0] to remove them.
We can use select-object -expand properties to see the properties but the will all be wrapped and delivered as a collection of hashes. See:
PS C:\scripts> $s.FindAll()|select -expand properties
Name Value
ridsetreferences {CN=RID Set,CN=SBS01,OU=Domain Controllers,DC=TESTLNET,DC=local}
logoncount {65535}
codepage {0}
objectcategory {CN=Computer,CN=Schema,CN=Configuration,DC=TESTLNET,DC=local}
iscriticalsystemobject {True}
operatingsystem {Windowsr Small Business Server 2011 Standard}
localpolicyflags {0}
Notice Name/Value pairs and the little squigglies: {}. Not very useful until we unwrap them.
This is one thing that always confuses the unwashed and unlevened of the computer trade. It goes totally against everything they have come to believe. Even I am surprised at how MS executed these bits. It is a big inconvenience until you
program active directory in C or C#...then it all starts to make sense...sort of.
¯\_(ツ)_/¯ -
Sy-subrc = 8 when looping through a table...
i am looping one table and reading other.
now sy-subr = 8,it is showing what can be the reason.
Thanks in advance.
Edited by: Julius Bussche on Feb 24, 2009 10:50 AM
Subject title improvedHi,
If
sy-subrc = 4 No lines were read.
sy-subrc = 8 The search key was not fully qualified.
So u can add the logic for sy-subrc = 8 or u can change the logic as
if sy-subrc is initial.
else.
endif.
Keerthi. -
Hye craig, hamid, christian and all ...........
i have a user access interface which i create where there are two fields username and password and a button,
i have also created a table USERS for users which have username and password fields ..... On useraccess interface i coded on WHEN BUTTON PRESSED like this
declare
go_block('users');
execute_query;
declare
begin
if :useraccess.username=:users.username and
:useraccess.password=:users.password then
go_block('MAINPAGE');
else
go_block('USERACCESS');
MESSAGE('SORRY WRONG PASSWORD OR NOT A REGISTERED USER');
MESSAGE('SORRY WRONG PASSWORD OR NOT A REGISTERED USER');
end if;
end;
This code works for a single user in USERS table but for multiple users there has to be some looping system
which matches the USERACCESS and USERS tables fields thoroughly ....Hi Majid,
I can suggest you a workaround for this. raise a ON-LOGON trigger and you can use the LOGON_SCREEN builtin to flash the logon screen at runtime. And then try capturing the username and password.
DECLARE
connected BOOLEAN := FALSE;
tries NUMBER := 3;
un VARCHAR2(30);
pw VARCHAR2(30);
cs VARCHAR2(30);
BEGIN
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
WHILE connected = FALSE and tries > 0
LOOP
LOGON_SCREEN;
un := GET_APPLICATION_PROPERTY( USERNAME );
pw := GET_APPLICATION_PROPERTY( PASSWORD );
cs := GET_APPLICATION_PROPERTY( CONNECT_STRING );
LOGON( un, pw || '@' || cs, FALSE );
IF FORM_SUCCESS
THEN
connected := TRUE ;
END IF;
tries := tries - 1;
END LOOP;
IF NOT CONNECTED THEN
MESSAGE('Too many tries!');
RAISE FORM_TRIGGER_FAILURE ;
END IF;
END ; a sample piece of coding to help you out.
Regards,
Manoj Chakravarthy -
Loop through tables based on data dict values
Hi,
I working on an old v7.3.4 database that I'm not familiar with and I want to loop through the tables and count the occurrence of a field value based on table names i've retrieved from the data dictionary. None of the tables have relational keys defined.
In a cursor I can loop thru all_tab_columns and load variables with the table, column names, and the datatype, but then I want to use these values in a second nested cursor to loop through each table found by the first cursor.
When I do :
Select var_colname from var_tabname
i get
The following error has occurred:
ORA-06550: line 23, column 10:
PLS-00356: 'V_TABNAME' must name a table to which the user has access
ORA-06550: line 22, column 5:
PL/SQL: SQL Statement ignored
ORA-06550: line 22, column 12:
PLS-00320: the declaration of the type of this expression is incomplete or malformed
ORA-06550: line 27, column 7:
PL/SQL: SQL Statement ignored
so it would seem I can't use a variable to substitute the table name in the 'from' clause. Does anyone know of a way round this ?
Thanks in advanceHi,
You will have to use dynamic sql to create your second cursor.
DECLARE
v_sql_query VARCHAR2(400);
TYPE cur_typ IS REF CURSOR;
c1 cur_typ;
mYRec MyTable%rowtype;
BEGIN
v_sql_query := 'select * from MyTable';
OPEN c1 FOR v_sql_query;
LOOP
FETCH c1 INTO mYRec;
EXIT WHEN c1%NOTFOUND;
EXIT WHEN c1%NOTFOUND IS NULL;
/*processing here*/
END LOOP;
CLOSE c1;
END;
Regards -
Hi folks,
I have a table with multiple rows which each one of them contains one dropdown list.
In my code I want to loop through this table rows and check each dropdown list's selected-item.
How can I do this in code(JavaScript).
Thank you,
YairCheck this thread,
it has solutions for JavaScript ind FormCalc.
http://forums.adobe.com/message/3345384#3345384 -
Loop through table(table is created dynamically)
Hi all,
I have a table that is created dynamically.It has got 3 columns and 8 rows.In first row - first column,I have a value that is set dynamically.Now, How can I loop through this table and get this value?
The table context node and value attributes are also created dynamically.
Table node is "TimesheetData" and value attribute is col1.Value,col1.Value and col3.Value
TimesheetData
col1.Value
col2.Value
col3.Value
Again.... this node and attributes are not there in my view context by default, its getting created and binded dynamically here.
Thanks KukkuHi,
Following is the code to iterate through the elements
//Table node is "TimesheetData" and value attribute is col1.Value,col1.Value and col3.Value
for(int x=0;x<wdContext.getChildNode("TimesheetData",0).size(); x++)
IWDNodeElement nodeElement = wdContext.nodeTimesheetData().getElementAt(x);
String value1 = (String) nodeElement.getAttributeValue("col1");
String value2 = (String) nodeElement.getAttributeValue("col2");
String value3 = (String) nodeElement.getAttributeValue("col3");
Regards
Ayyapparaj -
Hi Guys,
I have scenario where i call a BAPI and get return parameter as a table. I want to loop through this table in XI/BPM. Can i get some help on how to loop thorugh table in XI?Hi yashpal,
Bloack Step in a BPM is used to process a sequence of steps repeatedly for different information.
The block step can be processed using FOR EACH and PAR FOR EACH. For each will process the info one after the other and PAR FOR EACH will do it in parallel.
For more info on the Block Step Type in particular and the BPM in XI , check these links,
http://help.sap.com/saphelp_nw04/helpdata/en/f6/e1283f2bbad036e10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/62/dcef46dae42142911c8f14ca7a7c39/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/3c/831620a4f1044dba38b370f77835cc/content.htm
Hope this helps,
Regards,
Bhavesh -
Question about Looping through tables in Adobe Form
Hello,
We have an adobe form which is to be filled offline. It consists of a table. Table can have repeating rows and user can add\remove rows as they wish. The cardinality of the context node where we need to bind this table data is set to 1 n
We want to know the process to get all the values in the table back into our context node once the form is uploaded. I assume we need to loop through the table, and add elements to the context node. Can someone please let us know if were on the right track, and provide some sample code if possible?
<b>We cant figure out a way to loop through a table inside an Adobe form.</b>
We are using Web Dynpro Java with Adobe Livecycle Designer 7.1
Your help is much appreciated.
Thanks,
Rob.Try using...
for (z = 0; z < 16; z++) {
this["cb"+z].setStyle("styleName", "cssCBstyle");
That is the way to target them. I haven't dealt with setting styles, so I can't answer for that aspect working or not. -
Nested Loops...looping through one month of data at a time year by year
Hi all,
I'm trying to create an insert statement that loops through a table that has 10 years of data (2001 to 2010) month by month to minimize impact on server and commits more frequently to avoid filling up the redo logs and rollback tablespaces. The table is large, has about 40 millions records per year. Lets say the structure of the table is the following:
Customer_ID number(9),
Order_Item_1 number(6),
Order_Item_2 number(6),
Order_Item_3 number(6),
Order_date date
The table is in flat format but I want to normalize it so that it looks like the following:
Customer_ID Order_Seq Order_Item Order_date
999999999 1 555555 01-jan-2001
999999999 2 666666 01-jan-2001
999999999 3 444444 01-jan-2001
888888888 1 555555 03-jan-2001
888888888 2 666666 03-jan-2001
But because I want to loop through month by month....I need to set it up so that it loops through month by month, year by year (Using the Order Date Field) and Order_item by Order_item. Something like:
so my insert statements would be something like if I hardcoded instead of put the insert statement into a loop:
insert into orders_normalized
(Customer_id,Order_seq,Order_item,Order_date) select customer_id,1,Order_item,Order_date where Order_item_1 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='01';
insert into orders_normalized
(Customer_id,Order_seq,Order_item,Order_date) select customer_id,2,Order_item,Order_date where Order_item_2 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='01';
insert into orders_normalized
(Customer_id,Order_seq,Order_item,Order_date) select customer_id,3,Order_item,Order_date where Order_item_3 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='01';
insert into orders_normalized
(Customer_id,Order_seq,Order_item,Order_date) select customer_id,1,Order_item,Order_date where Order_item_1 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='02';
insert into orders_normalized
(Customer_id,Order_seq,Order_item,Order_date) select customer_id,2,Order_item,Order_date where Order_item_2 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='02';
insert into orders_normalized
(Customer_id,Order_seq,Order_item,Order_date) select customer_id,3,Order_item,Order_date where Order_item_3 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='03';
Hope this makes sense.
ThanksDoes the sequence of items in an order really matter? In other words, do we really need to preserve that an item was in position 2 versus position 1? I bet that the sequence or position of each item in an order is not meaningful. They were probably numbered 1, 2, and 3 just to make them uniquely named columns so there would be three slots to hold up to 3 items in the denormalized table.
You only have about 400 million rows to insert, so it could feasibly be done in a single transaction (depending on your database environment).
You can always do a create table as select (CTAS) to help with undo / redo issues and get better performance. You could run it in parallel, and spit it out to a new table partitioned by month. Single DDL statement running in parallel making your new table--sounds good to me.
How about something like this:
CREATE TABLE ORDERS_NORMALIZED
(CUSTOMER_ID, ORDER_ITEM, ORDER_DATE)
PARTITION BY RANGE(ORDER_DATE)
PARTITION p200901 VALUES LESS THAN (TO_DATE('200902','YYYYMM')),
PARTITION p200902 VALUES LESS THAN (TO_DATE('200903','YYYYMM')),
PARTITION p201012 VALUES LESS THAN (TO_DATE('201101','YYYYMM'))
as SELECT CUSTOMER_ID, ORDER_ITEM_1, ORDER_DATE
FROM OTHER_TABLE
WHERE ORDER_ITEM_1 IS NOT NULL
UNION ALL
SELECT CUSTOMER_ID, ORDER_ITEM_2, ORDER_DATE
FROM OTHER_TABLE
WHERE ORDER_ITEM_2 IS NOT NULL
UNION ALL
SELECT CUSTOMER_ID, ORDER_ITEM_3, ORDER_DATE
FROM OTHER_TABLE
WHERE ORDER_ITEM_3 IS NOT NULL.....................
Out of curiosity, why not normalize it further? You could have used two tables instead of one.
One (ORDER) with:
ORDER_ID
CUSTOMER_ID
DATE
Order_id would be a new surrogate key / primary key.
Another table (ORDER_ITEM) with:
ORDER_ID
ORDER_ITEM
It would be a table that links ORDERS to ITEMS. You get the idea.
Maybe you are looking for
-
I cannot start firefox. Error message tells me that it is already running. It is not running, but shows in task manager processes. If I end the process, I can start Firefox.
-
Impossible to install on my MacBook first generation
I try to install on my MacBook first generation with 70 gig of free space and after few minutes the installation program say "I can't copy imporant files on your hard disk, I have to restart the installation". I try to repair the hard disk, the progr
-
I downloaded the patch which allowed Premiere Pro 1.5 to work with HDV footage. I hooked up my Canon XL1s and captured the footage. Everything seemed to be working fine. I moved into After Effects to begin doing some work on a shot, and After Effect
-
About existence of added column in the database apex application.
Hi, I have created an report apex application based on the table. Consider the table as Employee_details The columns in the Employee_details tables are *) Employee_id *) name *) ip_address *) host_name *) port_no *) sys_type *) email_id *) login_id *
-
Master detail: select in form (newbie)
I've been looking at this example: http://labs.adobe.com/technologies/spry/samples/data_region/DataSetMasterDetailSample.html The bit of code I cannot understand is this: onchange="document.forms[0].citySelect.disabled = true; (That's in the first "s