|
Post by mikeukmid on Sept 28, 2007 7:52:29 GMT -5
How do I (or can I) print to an already defined textbox? I put data into a box, eg textbox #dat, 36.6 and I can read the data from that box but I can't change the initial data by command. What am I missing or not understanding?
Mike.
|
|
|
Post by StefanPendl on Sept 28, 2007 11:17:58 GMT -5
It is the same way as with the current LB version, just print to it Examples: #dat 70.45 #dat "test" Get it ;D
|
|
|
Post by mikeukmid on Sept 28, 2007 13:59:24 GMT -5
Stefan,
I assumed that was the method but it does not work, I get a message not understood error for #dat "test" and syntax error for #dat, "test"
Mike.
|
|
|
Post by carlgundel on Sept 28, 2007 14:28:20 GMT -5
You cannot set the contents of the textbox or textarea unless you do it when you create the widget. Generally you won't need to do anything else, and I'd like to hear why you are trying to do this.
I'm not against adding the functionality you seek, for the record.
Clearly you should not be seeing a message not understood error, and I'll definitely fix that.
-Carl
|
|
|
Post by mikeukmid on Sept 28, 2007 14:39:52 GMT -5
Thanks Carl, I was trying to print a default value to an existing textbox where a user has entered invalid data.
Mike.
|
|
|
Post by carlgundel on Sept 28, 2007 14:46:42 GMT -5
Thanks Carl, I was trying to print a default value to an existing textbox where a user has entered invalid data. You can set a default value like this: textbox #tb, "some value" May I suggest you have a look at the blogCSS and runWiki example programs to see how things are done there? -Carl
|
|
|
Post by carlgundel on Sept 28, 2007 15:04:34 GMT -5
Okay I've added print() and println(). Here's a working code sample:
print "Click the more link again and again." textarea #tb, "" print link #link, "more", [more] wait
[more] #tb println("more...") wait -Carl
|
|
|
Post by mikeukmid on Sept 28, 2007 15:05:19 GMT -5
Yes Carl, I do that at the start but if a user types an invalid value in one of my textboxes it needs the page to be cleared. Ah but then I could save the valid entries and re-present them to the user when the page is re-rendered. I have to get my head around the way web forms work I guess!
Mike.
|
|
|
Post by carlgundel on Sept 28, 2007 15:09:11 GMT -5
Okay I've added print() and println(). Here's a working code sample: print "Click the more link again and again." textarea #tb, "" print link #link, "more", [more] wait
[more] #tb println("more...") wait -Carl Oh yeah, also a text() method for setting or clearing the widget. -Carl
|
|
|
Post by mikeukmid on Sept 28, 2007 15:17:26 GMT -5
Thanks Carl that looks great! Silly me went and tried the example on RB personal server and wondered why it didn't work! Mike.
|
|
|
Post by carlgundel on Sept 28, 2007 15:29:35 GMT -5
Yes Carl, I do that at the start but if a user types an invalid value in one of my textboxes it needs the page to be cleared. Ah but then I could save the valid entries and re-present them to the user when the page is re-rendered. I have to get my head around the way web forms work I guess! I hope not. Run BASIC does a lot of work so that you don't have to understand web forms. -Carl
|
|
|
Post by mikeukmid on Sept 28, 2007 15:56:13 GMT -5
OK I promise, I wont study web forms!
Have to run and do some non-Run BASIC work now. ;D
|
|