checkbox$

All that relates to Javascript, CSS, HTML, ....
Post Reply
andywong
Posts: 13
Joined: Wed Mar 01, 2023 10:05 pm
Has thanked: 2 times

checkbox$

Post by andywong »

I am not getting the variable " A " change from the following code. textbox$(A) did changed on clicking. Please help.

A = 1
gosub myPage
timer0 500, tmp
wait

myPage:
A$ = A$ + checkbox$(A) + "AWB" + textbox$(A)
html a$
html "<br>"
html A
return

tmp:
refresh
return
END
andywong
Posts: 13
Joined: Wed Mar 01, 2023 10:05 pm
Has thanked: 2 times

Re: checkbox$

Post by andywong »

If I make a copy of the variable then it works.
code:
a = 1
b = 0
gosub myPage
timer0 1000 , ud
wait

myPage:
A$ = A$ + checkbox$(a) + "AWB" + textbox$(a)
html A$
html "<br>"
html textbox$(b)
return

ud:
b= a 'make a copy or will not work
refresh
return
END
User avatar
cicciocb
Site Admin
Posts: 2060
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1358 times
Contact:

Re: checkbox$

Post by cicciocb »

You should not use the same variable for several objects, in particular for the objects that can take an input from the page (such as the textboxes).

You could eventually use the same variable for the LED, for example :

Code: [Local Link Removed for Guests]

code:
a = 1
b = 0
gosub myPage
timer0 1000 , ud
wait

myPage:
cls
A$ = A$ + checkbox$(a) + "AWB" + textbox$(b) + led$(a) + led$(a)
html A$
html "<br>"
html textbox$(a)
return

ud:
b= a 'make a copy or will not work
refresh
return
END
Post Reply