update page according selection on a listbox$

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: update page according selection on a listbox$

Re: update page according selection on a listbox$

by TRS80_MKI » Thu Nov 21, 2024 1:53 pm

Hi cicciocb ,

i forget this :: if HtmlEventVar$ = "action$" then
for an old man like me , making an error as a little boy ... :oops:

thanks for the help
@+
TRS80_MKI

Re: update page according selection on a listbox$

by cicciocb » Thu Nov 21, 2024 11:57 am

try this :

Code: [Local Link Removed for Guests]

g_a$=""
g_a0$ = ""
g_a1$=""
g_a2$=""
g_a3$=""

b$=""
action$ = ""
act1$="Scan"
act2$="Calibration"
act3$="Camera"

init_scan g_a1$
init_calibration g_a2$
init_camera g_a3$
init_header g_a0$
g_a$= g_a0$

cls
html g_a$

onHtmlReload setpage0
onHtmlChange paramchange
autorefresh 1000
wait

setpage0:
cls
html g_a$
return

paramchange:
if HtmlEventVar$ = "action$" then
  b$ = action$
  select case b$
    case act1$: 'Scan
      g_a$= g_a0$ + g_a1$
    case act2$: 'Calibration
      g_a$= g_a0$ + g_a2$
    case act3$: 'Camera
      wlog action$
      g_a$= g_a0$ + g_a3$
    case else:
  end select
  cls
  html g_a$
end if
return

'-----------------------------------------------------
' WEB Page Button main header
'-----------------------------------------------------
sub init_header(g_a0$)
  g_a0$=""
  g_a0$ = g_a0$ + CSSID$("lbox", "width:300px; font-size:50px; ")
  g_a0$ =g_a0$ + listbox$(action$,"Scan,Calibration,Camera","lbox") + "<br> <br>"
end sub

'-----------------------------------------------------
' WEB Page Scan
'-----------------------------------------------------
sub init_scan(g_a1$)
  g_a1$ = ""
  g_a1$ = g_a1$ + "<h2>" + act1$ + "</h2>"
end sub

'-----------------------------------------------------
' WEB Page Calibration
'-----------------------------------------------------
sub init_calibration(g_a2$)
  g_a2$ = ""
  g_a2$ = g_a2$ + "<h2>" + act2$ + "</h2>"'font-size:2.8em
end sub

'-----------------------------------------------------
' WEB Page Config. Camera
'-----------------------------------------------------
sub init_camera(g_a3$)
  g_a3$ = ""
  g_a3$ = g_a3$ + "<h2>" + act3$ + "</h2>"
end sub

update page according selection on a listbox$

by TRS80_MKI » Thu Nov 21, 2024 11:18 am

Hi nice people,


Instead using TAB .. i'm a new old TRex .. JS is not my cup of tea ..
i want update the HTML page acording the selection on a listbox$.
But doesn't work ...
Any idea ..
this is a demo code :

@+
TRS80_MKI


g_a$=""
g_a0$ = ""
g_a1$=""
g_a2$=""
g_a3$=""

b$=""
action$ = ""
act1$="Scan"
act2$="Calibration"
act3$="Camera"

init_scan g_a1$
init_calibration g_a2$
init_camera g_a3$
init_header g_a0$
g_a$= g_a0$

cls
html g_a$

onHtmlReload setpage0
onHtmlChange paramchange
autorefresh 1000
wait

setpage0:
cls
html g_a$
return

paramchange:
b$ = HtmlEventVar$
select case b$
case act1$: 'Scan
g_a$= g_a0$ + g_a1$
case act2$: 'Calibration
g_a$= g_a0$ + g_a2$
case act3$: 'Camera
wlog action$
g_a$= g_a0$ + g_a3$
case else:
end select
return

'-----------------------------------------------------
' WEB Page Button main header
'-----------------------------------------------------
sub init_header(g_a0$)
g_a0$=""
g_a0$ = g_a0$ + CSSID$("lbox", "width:300px; font-size:50px; ")
g_a0$ =g_a0$ + listbox$(action$,"Scan,Calibration,Camera","lbox") + "<br> <br>"
end sub

'-----------------------------------------------------
' WEB Page Scan
'-----------------------------------------------------
sub init_scan(g_a1$)
g_a1$ = ""
g_a1$ = g_a1$ + "<h2>" + act1$ + "</h2>"
end sub

'-----------------------------------------------------
' WEB Page Calibration
'-----------------------------------------------------
sub init_calibration(g_a2$)
g_a2$ = ""
g_a2$ = g_a2$ + "<h2>" + act2$ + "</h2>"'font-size:2.8em
end sub

'-----------------------------------------------------
' WEB Page Config. Camera
'-----------------------------------------------------
sub init_camera(g_a3$)
g_a3$ = ""
g_a3$ = g_a3$ + "<h2>" + act3$ + "</h2>"
end sub

Top