How to post to a URL with Checkbox ?

2003-07-07 Thread Eric Chow
Hello,

If the HTML form is like the following :

form method=post action=/servlet/Show
input type=checkbox name=cb
input type=text name=n
input type=submit value=Show
/form


How can Post to /servlet/Show with the values as following ?

n=Eric   and the CheckBox should be CHECKED 

Please help ???



Best regards,
Eric





==
If you know what you are doing, 
it is not called RESEARCH!
==

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Array of values ???

2003-07-07 Thread Eric Chow
Hello,

The following is a HTML form with a set of same name. How can use
HttpClient to post them ??


Best regards,
Eric


=

script language=JavaScript
  C_ITEM_NO = 5;
  C_BOOKING_HOUR_LIMIT = 3;
  function check_input() {
i = 0;
fillCnt = 0;
loopCnt = C_ITEM_NO - 1;
isPrevItemEmptyFlag = false;
isItemValidFlag = false;
while (i = loopCnt) {
  isItemEmptyFlag = check_item_empty(i);
  if (isItemEmptyFlag == false) {
if (isPrevItemEmptyFlag == true) {
  alert(Please fill in your booking items in sequential order.);
  document.bform.wv_booking_date[i-1].focus();
  return false;
}
isItemValidFlag = check_item(i);
if (isItemValidFlag == false) {
  return false;
}
  isItemDuplicated = check_item_duplication(i);
  if (isItemDuplicated == true) {
return false;
  }

isBookingHourOverLimit = check_item_hour_over_limit(i);
if (isBookingHourOverLimit == true) {
return false;
}

fillCnt++;
  }
  if (document.bform.chk_booking_light[i].checked) {
document.bform.wv_booking_light[i].value = Y;
  } else {
document.bform.wv_booking_light[i].value = N;
  }
  if (document.bform.chk_booking_air[i].checked) {
document.bform.wv_booking_air[i].value = Y;
  } else {
document.bform.wv_booking_air[i].value = N;
  }
  isPrevItemEmptyFlag = (isItemEmptyFlag == true)?true:false;
  i++;
}
//alert(fillCnt:  + fillCnt);
if (parseInt(fillCnt) == 0) {
   alert(Please fill in at least one activity.);
  document.bform.wv_booking_date[0].focus();
  return false;
}
return true;
  }

  function FromTimeChange(i)
  {
document.bform.wv_booking_time_to[i].options.selectedIndex =
document.bform.wv_booking_time_from[i].options.selectedIndex
return true;
  }

  function check_facility_existence (i) {
  if (document.bform.wv_booking_place[i].options.selectedIndex == 0) {
document.bform.chk_booking_light[i].disabled=false;
document.bform.chk_booking_air[i].disabled=false;
  }
  if (trim(document.bform.wv_booking_place[i].value) == 'PAV') {
document.bform.chk_booking_light[i].disabled=true;
document.bform.chk_booking_light[i].checked=false;
document.bform.chk_booking_air[i].disabled=false;
}
  if (trim(document.bform.wv_booking_place[i].value) == 'SQ1') {
document.bform.chk_booking_light[i].disabled=true;
document.bform.chk_booking_light[i].checked=false;
document.bform.chk_booking_air[i].disabled=false;
}
  if (trim(document.bform.wv_booking_place[i].value) == 'SQ2') {
document.bform.chk_booking_light[i].disabled=true;
document.bform.chk_booking_light[i].checked=false;
document.bform.chk_booking_air[i].disabled=false;
}
  if (trim(document.bform.wv_booking_place[i].value) == 'T1') {
document.bform.chk_booking_light[i].disabled=false;
document.bform.chk_booking_air[i].disabled=true;
document.bform.chk_booking_air[i].checked=false;
}
  if (trim(document.bform.wv_booking_place[i].value) == 'T2') {
document.bform.chk_booking_light[i].disabled=false;
document.bform.chk_booking_air[i].disabled=true;
document.bform.chk_booking_air[i].checked=false;
}
  if (trim(document.bform.wv_booking_place[i].value) == 'ZDR') {
document.bform.chk_booking_light[i].disabled=true;
document.bform.chk_booking_light[i].checked=false;
document.bform.chk_booking_air[i].disabled=false;
}
  if (trim(document.bform.wv_booking_place[i].value) == 'ZS1') {
document.bform.chk_booking_light[i].disabled=true;
document.bform.chk_booking_light[i].checked=false;
document.bform.chk_booking_air[i].disabled=true;
document.bform.chk_booking_air[i].checked=false;
}
  if (trim(document.bform.wv_booking_place[i].value) == 'ZS2') {
document.bform.chk_booking_light[i].disabled=true;
document.bform.chk_booking_light[i].checked=false;
document.bform.chk_booking_air[i].disabled=true;
document.bform.chk_booking_air[i].checked=false;
}
}


  function check_item(i) {
  if ( document.bform.wv_booking_date[i].options.selectedIndex == 0)
  {
alert(The booking date is invalid);
document.bform.wv_booking_date[i].focus();  return false;
  }
  if ( document.bform.wv_booking_place[i].options.selectedIndex == 0)
  {
alert(The booking place is empty);
document.bform.wv_booking_place[i].focus();  return false;
  }
  v_facilities = trim(document.bform.wv_booking_facilities[i].value);
  if (trim(document.bform.wv_booking_place[i].value) == 'PAV') {
if (v_facilities.length == 0) {
  alert(Please specify the facilities for using the complex
Pavilion, e.g. soccer,  +
basketball, volleyball, badminton, table tennis or
handball,etc);
  document.bform.wv_booking_facilities[i].focus(); return false;
}
  }