Changeset 12035


Ignore:
Timestamp:
2006-07-06T14:06:12+12:00 (18 years ago)
Author:
mdewsnip
Message:

Fixed the problem with the values not matching up to the indexes once the indexes change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cic-hcap/macros/extra.dm

    r11991 r12035  
    890890}
    891891
    892 _cicaqpdefault_ {<select name='aqp'><option value='0'>contains</option><option value='1'>is</option></select>}
    893 _cicaqptypeofplace_ {<select name='aqp' disabled='true'><option value='0'>contains</option><option value='1' selected='true'>is</option></select>}
    894 
    895 _cicaqvdefault_ {<input name='aqv' type='text' style='width: 450px'/>}
    896 _cicaqvtypeofplace_ {<select name='aqv' style='width: 450px'><option value='Individual building'>Individual building</option><option value='Landscape site'>Landscape site</option><option value='Campus arrangement'>Campus arrangement</option><option value='Building group'>Building group</option></select>}
     892_cicaqpdefault_ {<select id='aqp_1_field' name='aqp'><option value='0'>contains</option><option value='1'>is</option></select>}
     893_cicaqptypeofplace_ {<select id='aqp_1_field' name='aqp' disabled='true'><option value='0'>contains</option><option value='1' selected='true'>is</option></select>}
     894
     895_cicaqvdefault_ {<input id='aqv_1_field' name='aqv' type='text' style='width: 450px'/>}
     896_cicaqvtypeofplace_ {<select id='aqv_1_field' name='aqv' style='width: 450px'><option value='Individual building'>Individual building</option><option value='Landscape site'>Landscape site</option><option value='Campus arrangement'>Campus arrangement</option><option value='Building group'>Building group</option></select>}
    897897
    898898_cicaqline_ {
     
    910910
    911911    <span id="aqp_1_">
    912       _cicaqpdefault_
     912      _cicaqpdefault_(_1_)
    913913    </span>
    914914
    915915    <span id="aqv_1_">
    916       _cicaqvdefault_
     916      _cicaqvdefault_(_1_)
    917917    </span>
    918918
     
    12281228   for (var i = 0; i < document.QueryForm.aqi.length; i++) \{
    12291229      if (document.QueryForm.aqi[i].value != document.QueryForm.aqib[i].value) \{
    1230          alert("Changed " + i + ": " + document.QueryForm.aqi[i].value);
    12311230         if (document.QueryForm.aqi[i].value == "PL") \{
    1232             document.getElementById("aqp" + i).innerHTML = "_cicaqptypeofplace_";
    1233         document.getElementById("aqv" + i).innerHTML = "_cicaqvtypeofplace_";
     1231            document.getElementById("aqp" + i).innerHTML = "_cicaqptypeofplace_(" + i + ")";
     1232        document.getElementById("aqv" + i).innerHTML = "_cicaqvtypeofplace_(" + i + ")";
    12341233     \}
    12351234     else \{
    1236             document.getElementById("aqp" + i).innerHTML = "_cicaqpdefault_";
    1237         document.getElementById("aqv" + i).innerHTML = "_cicaqvdefault_";
     1235            document.getElementById("aqp" + i).innerHTML = "_cicaqpdefault_(" + i + ")";
     1236        document.getElementById("aqv" + i).innerHTML = "_cicaqvdefault_(" + i + ")";
    12381237     \}
    12391238
     
    12491248   document.QueryForm.q.value = "";
    12501249
    1251    for (var i = 0; i < document.QueryForm.aqi.length; i++) \{
    1252       alert(i + ": " + document.QueryForm.aqi[i].value + "," + document.QueryForm.aqv[i].value);
     1250   for (var i = 0; i < document.QueryForm.aqv.length; i++) \{
    12531251      if (document.QueryForm.aqv[i].value != "") \{
    1254          addQueryTerm(document.QueryForm.q, "[" + document.QueryForm.aqv[i].value + "]:" + document.QueryForm.aqi[i].value);
    1255      alert(document.QueryForm.aqi[i].value + " -- " + document.QueryForm.q.value);
     1252         var real_index = /aqv([0-9]+)field/.exec(document.QueryForm.aqv[i].id)[1];
     1253         addQueryTerm(document.QueryForm.q, "[" + document.QueryForm.aqv[i].value + "]:" + document.QueryForm.aqi[real_index].value);
    12561254      \}
    12571255   \}
Note: See TracChangeset for help on using the changeset viewer.