|
Post by kokenge on Jan 30, 2009 6:43:22 GMT -5
How can you stop input data from changing back to the original value? In this example I have 2 input values. One is a HTML <INPUT and one is a RB textbox. When you change the values and click [Go] the HTMP <INPUT goes back to the original value. How do you stop it from going back to the original value.?? [loop] cls html "<HR>" a$ = "abcd" html "<input id='#a' size=4 value='";a$;"' autocomplete=off />" textbox #a,a$,4 html "<HR>" button #go, "Go", [go] wait [go] wait
Thanks for the help..
|
|
|
Post by JackWebb on Jan 30, 2009 18:50:34 GMT -5
Hi K, Not sure if this is the answer you're looking for but I suspect you're trying to do something more complex. a$ = "abcd" [loop] cls html "<HR>" 'a$ = "abcd" html "<input id='#a' size=4 value='";a$;"' autocomplete=off />" textbox #a,a$,4 html "<HR>" button #go, "Go", [go] wait [go] 'wait a$=#a contents$() goto [loop]
Hope that helps J.W.
|
|
|
Post by Carl Gundel - admin on Jan 31, 2009 0:23:14 GMT -5
The input field you insert with your code is not managed by Run BASIC. When you click on the Go button the page gets rendered again, and so does your original HTML code including the abcd. What you need to do is get the contents out of the input field in your [go] routine. Use the #request object to get the value. To do this you must add a name property to the input element. Here is an example: getInput$ = "abcd" getTextbox$ = "abcd" gosub [display] wait
[go] getInput$ = #request get$("input") getTextbox$ = #a contents$() gosub [display] print "The input field holds: "; getInput$ print "The textbox holds: "; getTextbox$ wait
[display] cls html "<input id='#a' name='input' size=4 value='";getInput$;"' autocomplete=off />" textbox #a,getTextbox$,4 button #go, "Go", [go] print return Here is a version with only the input element. getInput$ = "abcd" gosub [display] wait
[go] getInput$ = #request get$("input") gosub [display] print "The input field holds: "; getInput$ wait
[display] cls html "<input id='#a' name='input' size=4 value='";getInput$;"' autocomplete=off />" button #go, "Go", [go] print return -Carl
|
|
|
Post by kokenge on Jan 31, 2009 4:45:35 GMT -5
Thanks Carl. I was hoping that I wouldn't have to make the round trip.
I was going to change all my stuff to HTML <INPUT because I needed some extra features. But if it is going to cost a round trip, I'll have to look into using CSS and textboxes.
Thanks for the help..
|
|
|
Post by kokenge on Jan 31, 2009 7:17:12 GMT -5
Ok! I give up.. The <input tag accepts the autocomplete=off. Why doesn't this set autocomplete off for the textbox, call SetCSS html "<input id='#a' size=4 autocomplete=off />" textbox #a,"",4 #a setid("ao") 'set autocomplete=off wait
SUB SetCSS cssid #ao, "{AUTOCOMPLETE:off}" END SUB
|
|
|
Post by StefanPendl on Jan 31, 2009 9:24:58 GMT -5
Auto-complete is not a style, but an attribute. You can not set attributes through CSS and JS only supports changing some of the attributes.
The autocomplete attribute seems to be IE only and other browsers need the tags in the head to make things work.
Best viewed with Any-Browser would be nice, bad boys at M$ ...
|
|
|
Post by kokenge on Jan 31, 2009 10:20:58 GMT -5
Amen to that!
I tried it in the header and couldn't get it to work. So how do we get autocomplete off without using the <input tag.
Looks like we need a #handle setAtrib()
Thanks for the help.
|
|
|
Post by StefanPendl on Feb 1, 2009 4:29:58 GMT -5
With "tags in the head" I meant the code used in the form data / auto complete thread: head "<meta http-equiv='cache-control' content='no-cache,no-store,must-revalidate,max-age=0'> <meta http-equiv='pragma' content='no-cache'>"
|
|
|
Post by StefanPendl on Feb 1, 2009 4:31:37 GMT -5
I tried to use this, but then encountered another problem, where the contents of the RB text box could not be retrieved. 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 print "RB Text Box" textbox #box, "" print print
'HTML 5 Info at www.w3schools.com/tags/html5_input.asp 'HTML replacement for text box without auto complete print "HTML Text Box" html "<input type='text' id='#boxHTML' name='#boxHTML' value='"; text$; _ "' autocomplete='off' autofocus='true' />" print print link #action, "Accept", [accept] print wait
[accept] print #box contents$(text$) print text$ print print #request get$("#boxHTML") print link #reload, "Reload", [restart] print wait
|
|
|
Post by kokenge on Feb 1, 2009 11:20:20 GMT -5
OK! Thanks for the help..
|
|