1
µTasker general / Re: HTML parameters update, however browser controls don't indicate
« on: October 04, 2023, 10:03:01 PM »
Hi Mark,
Yes, I definitely have a general lack of HTML skills, but luckily the online live html editors work really well.
1) I was not properly using IS_CHECKED, IS_SELECTED, NOT_SELECTED, nor IS_DISABLED correctly, I think I've got that working.
2) I needed to separate the selection variables on the two controls fnIsSelected *ptrBuffer. using case "$sCS": for the DST checkbox, and repurposed "$sB_" for the list box
3) commented out all unused options to prevent unintended consequences
I believe it is working correctly, I'll test more over the next few days
I didn't see how to "store" the result of the variable sent to fnHandleWeb() for the drop down box here:
/sntpcfg.htm?C=g&D=CS&IT0=172.22.1.59&r=Save
I took 'g' and stored it in a local unsigned char variable to use in the fnIsSelected()
unsigned char ListChoice = 0;
static unsigned char fnIsSelected(unsigned char *ptrBuffer)
{
// Format $sAB (length assumed to be 4 bytes, even when both parameters are not used)
//
unsigned char ucCheck = NOT_SELECTED;
switch (*ptrBuffer++) {
case 'C': // Custom codes
switch (*ptrBuffer) {
case 'S': // DST checkbox
if((temp_pars->temp_parameters.ucTimeZoneFlags&0x80)>0) return IS_CHECKED;
else return NOT_SELECTED;
default:
return IS_DISABLED;
}
case 'B': // Custom codes for time zone choice
if(ListChoice == *ptrBuffer) return IS_SELECTED;
else return NOT_SELECTED;
..
..
..
static int fnHandleWeb(unsigned char ucType, CHAR *ptrData, HTTP *http_session)
{
static unsigned char NewTimezoneData = 0;
unsigned char *ucPtr;
switch (ucType) {
case 'C': /// RJS Variable found "C="_
switch (*++ptrData) { // preincrement past '=' need to switch a..z..A..H to capture all 34
case 'a':
ListChoice = *ptrData;
NewTimezoneData = 0; // set the timezone to 'a'
break;
Thank You! Everything seems to be running smoothly now.
Yes, I definitely have a general lack of HTML skills, but luckily the online live html editors work really well.
1) I was not properly using IS_CHECKED, IS_SELECTED, NOT_SELECTED, nor IS_DISABLED correctly, I think I've got that working.
2) I needed to separate the selection variables on the two controls fnIsSelected *ptrBuffer. using case "$sCS": for the DST checkbox, and repurposed "$sB_" for the list box
3) commented out all unused options to prevent unintended consequences
I believe it is working correctly, I'll test more over the next few days
I didn't see how to "store" the result of the variable sent to fnHandleWeb() for the drop down box here:
/sntpcfg.htm?C=g&D=CS&IT0=172.22.1.59&r=Save
I took 'g' and stored it in a local unsigned char variable to use in the fnIsSelected()
unsigned char ListChoice = 0;
static unsigned char fnIsSelected(unsigned char *ptrBuffer)
{
// Format $sAB (length assumed to be 4 bytes, even when both parameters are not used)
//
unsigned char ucCheck = NOT_SELECTED;
switch (*ptrBuffer++) {
case 'C': // Custom codes
switch (*ptrBuffer) {
case 'S': // DST checkbox
if((temp_pars->temp_parameters.ucTimeZoneFlags&0x80)>0) return IS_CHECKED;
else return NOT_SELECTED;
default:
return IS_DISABLED;
}
case 'B': // Custom codes for time zone choice
if(ListChoice == *ptrBuffer) return IS_SELECTED;
else return NOT_SELECTED;
..
..
..
static int fnHandleWeb(unsigned char ucType, CHAR *ptrData, HTTP *http_session)
{
static unsigned char NewTimezoneData = 0;
unsigned char *ucPtr;
switch (ucType) {
case 'C': /// RJS Variable found "C="_
switch (*++ptrData) { // preincrement past '=' need to switch a..z..A..H to capture all 34
case 'a':
ListChoice = *ptrData;
NewTimezoneData = 0; // set the timezone to 'a'
break;
Thank You! Everything seems to be running smoothly now.