| View previous topic :: View next topic |
| Author |
Message |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Sat Jul 23, 2005 7:37 pm Post subject: Help with Browser Element |
|
|
Crazy question.
Anyone know how to get the information from HTML input forms and transfer them to VDS variables?
This would allow us to more fully access HTML elements, not just click events. Could use textareas, checkboxes, radio elements, all kinds of neat stuff from HTML and send into VDS as variables.
I've spent a couple of hours on it, no luck yet.
Brandon ('NodNarb') Cunningham |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sun Jul 24, 2005 12:18 am Post subject: |
|
|
from memory, skit (?) wrote a little thingy that showed how to do that
he used vds to display the html code though and not msie or firefox... and at the click of a button on the form, the contents of textboxes was transfered to vds variables
a search at the forum should help you find it . . . sorry i can't be more specific
serge _________________
|
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Sun Jul 24, 2005 8:11 am Post subject: |
|
|
Thanx a bunch!
I've been working on some code before I saw that though, and my code is solid, but it hangs in VDS (line22). Is there an updated version of the browser element I need to know about?
| Code: | external vdsbrw50.dll
#define command,browser
#define function,browser
DIALOG CREATE,New Dialog,-1,0,539,200,,CLASS medo
REM *** Modified by Dialog Designer on 7/24/2005 - 02:37 ***
DIALOG ADD,BROWSER,BROWSER1,0,0,330,200,about:blank,,nonavigate,nonewwindows
DIALOG ADD,TEXT,TEXT1,2,350,,,TEXT1
DIALOG SHOW
rem NOTE textarea exists outside of <form> tags
dialog set,BROWSER1,<html><body><textarea name=@chr(34)textarea1@chr(34) rows='5' cols='50' wrap='Virtual'></textarea><form action='javascript:document.write(textarea1.innerHTML)'><input type='submit' value='OK'></form></body></html>
:evloop
wait event
%%event = @event()
goto %%event
:browser1navigate
%%navURL = @browser(browser1,navURL)
if @equal(%%navURL,javascript:document.write(textarea1.innerHTML))
dialog set,browser1,javascript:document.write(textarea1.innerHTML)
%%variable = @dlgtext(browser1)
dialog set,text1,%%variable
dialog set,browser1,<html><body><textarea name=@chr(34)textarea1@chr(34) rows='5' cols='50' wrap='Virtual'>%%variable</textarea><form action='javascript:document.write(textarea1.innerHTML)'><input type='submit' value='OK'></form></body></html>
end
goto evloop
:close
exit
|
NodNarb |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Sun Jul 24, 2005 3:41 pm Post subject: |
|
|
Well, I am going to go ahead and defend my syntax above. Its correct, and VDS should not hang on it. In my opinion, its a bug, and if my method worked it would save us a parse process.
HOWEVER
I overlooked the form method html code in your old post skit that passes the information in the return url string....thats exactly what I needed!
Thank you!
NodNarb |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Sun Jul 24, 2005 6:58 pm Post subject: |
|
|
| Languages such as Delphi work the same. If you put ( ), characters in code you have to enclose them otherwise it appears you are trying to call an undefined procedure or function. In fact delphi won't even let you compile the code until it's fixed. |
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Mon Jul 25, 2005 5:14 pm Post subject: |
|
|
Have I reached the VDS forum?
Because you do realize, in Visual Basic.Net you can't assign values to a variant data type. You have to define as string, or array etc.
The code I posted is 100% VDS compatible. I don't think it will work in Delphi.
Brandon |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Mon Jul 25, 2005 8:11 pm Post subject: |
|
|
You are free to code your program as you see fit, but if you start finding your code not working on other computers or issues arising you should look at your code first before calling it a bug in the language. Your code may work fine but is there really any harm in adding two " around strings? It really can't be that hard.
From the VDS 5 Help file:
| Quote: |
In DialogScript, all variables and parameters to commands and functions are strings, even if they look like numbers. Strings can contain embedded variables and functions, which are substituted or evaluated as the string is processed from left to right.
So if %D contains C: then the string:
Drive %D has @VOLINFO(%D,F)Kb free
would be evaluated to:
Drive C: has 32456Kb free
Note that the symbols % and @ (which are used to denote variables and functions), commas (which are used to split strings into two or more parameters for commands or functions that expect multiple parameters), and brackets (which enclose the parameters of an individual function), cannot normally appear in a string because of the special meaning attached to them. To overcome this, strings can be enclosed in double quotes (").
Text within double quotes is interpreted simply as text: no variable substitution or function evaluation will be performed. Quotes can appear anywhere in a string to prevent substitution or evaluation for a particular section, as in this example:
%A = Order @input(Enter quantity,1) "widgets @ "%R" each (incl. "%T"% sales tax")
|
|
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Mon Jul 25, 2005 9:25 pm Post subject: |
|
|
Works great here
That is to say, brackets most definitely are not considered by the interpreter unless they are preceeded by a @ qualifier. The language is more forgiving than the documentation, or the people who aren't really trying to help anyone.
Of course, if your into making programming a religion then more power to your dogmatic thinking. After all, syntax rules are much more important than assistance.
NodNarb
Last edited by cnodnarb on Mon Jul 25, 2005 9:38 pm; edited 1 time in total |
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Mon Jul 25, 2005 9:35 pm Post subject: |
|
|
Dear community,
In order to not end up debating without solving any problems or having people not see the real issue, there is a bug with the @dlgtext(browser1) function as is addressed by this "corrected" code.
Can anyone HELP me?
Verification of existance of a bug by simply testing the script is considered help as well as any possible work around.
| Code: | external vdsbrw50.dll
#define command,browser
#define function,browser
DIALOG CREATE,New Dialog,-1,0,539,200,,CLASS medo
rem *** Modified by Dialog Designer on 7/24/2005 - 02:37 ***
DIALOG ADD,BROWSER,BROWSER1,0,0,330,200,about:blank,,nonavigate,nonewwindows
DIALOG ADD,TEXT,TEXT1,2,350,,,TEXT1
DIALOG SHOW
rem NOTE textarea exists outside of <form> tags
dialog set,BROWSER1,"<html><body><textarea name="@chr(34)"textarea1"@chr(34)" rows='5' cols='50' wrap='Virtual'></textarea><form action='javascript:document.write(textarea1.innerHTML)'><input type='submit' value='OK'></form></body></html>"
:evloop
wait event
%%event = @event()
goto %%event
:browser1navigate
%%navURL = @browser(browser1,navURL)
if @equal(%%navURL,"javascript:document.write(textarea1.innerHTML)")
dialog set,browser1,"javascript:document.write(textarea1.innerHTML)"
%%variable = @dlgtext(browser1)
dialog set,text1,%%variable
dialog set,browser1,"<html><body><textarea name="@chr(34)"textarea1"@chr(34)" rows='5' cols='50' wrap='Virtual'>%%variable</textarea><form action='javascript:document.write(textarea1.innerHTML)'><input type='submit' value='OK'></form></body></html>"
end
goto evloop
:close
exit |
NodNarb |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Mon Jul 25, 2005 11:28 pm Post subject: |
|
|
Hopefully someone will help you out, but your continued remarks at people who are TRYING to point out potential problems with your code are not helpful. No one is trying to personally attack you or your coding style, rather you are taking it peronsally while the majority of us are trying to explain that using/not using ", (, ), @, properly can lead to problems in your code.
Here are two problems with your code:
| Quote: |
:browser1navigate
%%navURL = @browser(browser1,navURL)
if @equal(%%navURL,"javascript:document.write(textarea1.innerHTML)")
dialog set,browser1,"javascript:document.write(textarea1.innerHTML)"
%%variable = @dlgtext(browser1)
dialog set,text1,%%variable
dialog set,browser1,"<html><body><textarea name="@chr(34)"textarea1"@chr(34)" rows='5' cols='50' wrap='Virtual'>%%variable</textarea><form action='javascript:document.write(textarea1.innerHTML)'><input type='submit' value='OK'></form></body></html>"
end
goto evloop
|
dialog set,browser1,"javascript:document.write(textarea1.innerHTML)"
There appears to be a problem when this line is used. After executing this line the control seems to freeze up on any @dlgtext(browser1) response. It seems to cause the browser to think nothing is written to the browser window and/or some internal javascript issues causing IE to freeze up on a dlgtext(browser1) call.
dialog set,browser1,"<html><body><textarea name="@chr(34)"textarea1"@chr(34)" rows='5' cols='50' wrap='Virtual'>%%variable</textarea><form action='javascript:document.write(textarea1.innerHTML)'><input type='submit' value='OK'></form></body></html>"
Problems here with " missing causing the text %%variable to be written to the text area instead of the real contents of the variable. Should be:
| Quote: |
dialog set,browser1,"<html><body><textarea name="@chr(34)"textarea1"@chr(34)" rows='5' cols='50' wrap='Virtual'>"%%variable"</textarea><form action='javascript:document.write(textarea1.innerHTML)'><input type='submit' value='OK'></form></body></html>" |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|