form data / auto complete

new BookmarkLockedFalling
aristarkos
New Member
*

aristarkos Avatar

Posts: 48

Post by aristarkos on Jan 25, 2009 18:42:34 GMT -5

I'm trying to disable autocomplete, but my attempts caused my program to stop working normally ... as if every value was zero ... perhaps.

I used...

head "<meta http-equiv=""cache-control"" content=""no-cache,no-store,must-revalidate,max-age=0"">
<meta http-equiv=""pragma"" content=""no-cache"">"

html "<form autocomplete=""off""></form>"

I also used that last html line by itself. I don't know much about this. I just found something at another forum and tried to adapt it. I would like to disable autocomplete when Input is used, but still be able to carry values throughout the running of the program (assuming that's where the problem is).

Any tips?
StefanPendl
Global Moderator
*****

StefanPendl Avatar

Run for BASIC ...
Posts: 945

Last Edit: Jan 26, 2009 2:37:48 GMT -5 by StefanPendl
[b]Stefan[/b] - [a href=http://stefanpendl.runbasichosting.com/]Homepage[/a][br][br][b]Please give credit if you use code I post, no need to ask for permission.[/b][br][br]Run BASIC 1.01, Fire-/Waterfox (IE11, Edge), Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
aristarkos
New Member
*

aristarkos Avatar

Posts: 48

StefanPendl
Global Moderator
*****

StefanPendl Avatar

Run for BASIC ...
Posts: 945

[b]Stefan[/b] - [a href=http://stefanpendl.runbasichosting.com/]Homepage[/a][br][br][b]Please give credit if you use code I post, no need to ask for permission.[/b][br][br]Run BASIC 1.01, Fire-/Waterfox (IE11, Edge), Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
aristarkos
New Member
*

aristarkos Avatar

Posts: 48

StefanPendl
Global Moderator
*****

StefanPendl Avatar

Run for BASIC ...
Posts: 945

Post by StefanPendl on Jan 28, 2009 4:19:28 GMT -5

Below find a working example.
The key to success is using HTML input boxes, the name property is mandatory and will be used with #request to get the contents of the text field.
This is tested as a published application with FF3 and IE7.

head "<meta http-equiv='cache-control' content='no-cache,no-store,must-revalidate,max-age=0'>
<meta http-equiv='pragma' content='no-cache'>"

[restart]
cls
text$ = "Hello world!"
print
'RB command
'textbox #box, text$

'HTML 5 Info at www.w3schools.com/tags/html5_input.asp
'HTML replacement for text box without auto complete
html "<input type='text' class='text' id='#box' name='#box' value='"; text$; _
"' autocomplete='off' autofocus='true' />"
print
print
link #action, "Accept", [accept]
print
wait

[accept]
text$ = #request get$("#box")
print
print text$
print
link #reload, "Reload", [restart]
print
wait
[b]Stefan[/b] - [a href=http://stefanpendl.runbasichosting.com/]Homepage[/a][br][br][b]Please give credit if you use code I post, no need to ask for permission.[/b][br][br]Run BASIC 1.01, Fire-/Waterfox (IE11, Edge), Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
aristarkos
New Member
*

aristarkos Avatar

Posts: 48

Post by aristarkos on Jan 29, 2009 16:25:24 GMT -5

Thank you!

I need to input numbers but I can use: val(mid$(text,ドル 1, 1))

Do you know if the HTML INPUT can be used so that I can just hit the Enter key ... instead of clicking on a link or button?

-----------------------------------

head "<meta http-equiv='cache-control' content='no-cache,no-store,must-revalidate,max-age=0'> <meta http-equiv='pragma' content='no-cache'>"
[restart] cls
print
text$="1234"
html "<input type='text' class='text' id='#box' name='#box' value='"; text$; "' autocomplete='off' autofocus='true' />"
print
print
link #action, "Accept", [accept]
print
wait

[accept] text$ = #request get$("#box")
print text$
print
print "1st char multiplied by 100 = "; val(mid$(text,ドル 1, 1))*100
print "2nd char multiplied by 100 = "; val(mid$(text,ドル 2, 1))*100
print "3rd char multiplied by 100 = "; val(mid$(text,ドル 3, 1))*100
print "4th char multiplied by 100 = "; val(mid$(text,ドル 4, 1))*100
print
link #reload, "Reload", [restart]
print
wait
aristarkos
New Member
*

aristarkos Avatar

Posts: 48

StefanPendl
Global Moderator
*****

StefanPendl Avatar

Run for BASIC ...
Posts: 945

Post by StefanPendl on Jan 30, 2009 2:17:39 GMT -5

aristarkos Avatar

I need to input numbers but I can use: val(mid$(text,ドル 1, 1))


Add the attribute inputmode='latin digits' to only allow numbers.


Do you know if the HTML INPUT can be used so that I can just hit the Enter key ... instead of clicking on a link or button?


I don't know, I haven't had a need for such, but you can try to add a button of type submit.
An example can be found on the page I included in the code.
[b]Stefan[/b] - [a href=http://stefanpendl.runbasichosting.com/]Homepage[/a][br][br][b]Please give credit if you use code I post, no need to ask for permission.[/b][br][br]Run BASIC 1.01, Fire-/Waterfox (IE11, Edge), Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
aristarkos
New Member
*

aristarkos Avatar

Posts: 48

Post by aristarkos on Jan 30, 2009 2:36:54 GMT -5

Thanks.

What I really need is for the cursor to be in the field from the start ... so I don't have to click on it every time. Apparently, this can be done with javascript. So I'm trying to learn enough about JS to create an input that includes...
  • autocomplete off
  • auto cursor placement
  • use of enter key (not click on link)
I'll be inputting four numbers together and then the program will act on each individual digit.
Last Edit: Feb 10, 2009 22:46:44 GMT -5 by aristarkos