[Webwork-user] Form - appending formnames based on row-number
Brought to you by:
baldree,
rickardoberg
From: <rr...@ne...> - 2002-08-16 08:53:56
|
To Webwork-users. We have a form with a number of data. We save changed whenever the user changes the data in a form-field (onChange event) We need to make some calculations based on other values on the same row. = In order to handle this this want to append the row number on each field-nam= e. Example: Item Actual count Min. count Wanted count Ordercount 1 5 5 10 5 5 10 5 10 0 9 6 5 10 0 15 12 5 10 0 Each formfield is named based on their column name eg: itemId currCount minValue wantedValue orderCount There exist getxxx for each column. There exist and iterator to traverse through the list of items. Changing the field for item 9, min. count to 7 should change ordercount t= o 4. We need in the client javascript to be able to get each field and its val= ue. Furthermore we would like the user to be able to press key-down/up and ju= mp from field to field. (future option) So from my point of view we have two options. One is naming each formfield with the item-id. So the formfieldnames woul= d be itemId1 currCount1 minValue1 wantedValue1 orderCount1 itemId5 currCount5 minValue5 wantedValue5 orderCount5 itemId9 currCount9 minValue9 wantedValue9 orderCount9 itemId15 currCount15 minValue15 wantedValue15 orderCount15 Calling the onChange script should then send the itemId as an parameter. How could we name the field based on the itemId ? And how should this loo= k like for webwork ? The second option (and our prefered) - using a rowcounter eg: itemId1 currCount1 minValue1 wantedValue1 orderCount1 itemId2 currCount2 minValue2 wantedValue2 orderCount2 itemId3 currCount3 minValue3 wantedValue3 orderCount3 itemId4 currCount4 minValue4 wantedValue4 orderCount4 This will help us move up and down, and would be easier when we are not using a simple primary-key like itemId. How can we setup WebWork to handle a rowcounter in an iterator, and how c= an we append it to the name-field ?? And inputs would be really appreciated thank in advance - Ren=E9 Nygaard Net-Mill |