forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Embedded HTML apps
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Knowledge Base
View previous topic :: View next topic  
Author Message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Mon Jan 17, 2005 12:14 pm    Post subject: Reply with quote

That would certainly be useful. The reason the extension doesn't provide this at the moment is because the event generated by the component it uses simply allows you to decide whether to allow the new window or not. It doesn't tell you the URL it would like to open. And these new window links don't, for some reason, trigger the navigate event. Without knowing whether there is an updated component that supports this capability, I can't say whether it will be possible to implement this in VDS 6 either.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Feb 06, 2005 12:43 pm    Post subject: Reply with quote

I created a little example how you can use the browser element to display a form which users can fill out. I also created a function "ParseURL" which you can use to parse out values from form-fields... Smile

Code:
______________________________________________________________________________________________________________________________________________________________________________________________________________
external vdsbrw50.dll
#define function,browser
#define function,ParseURL

  DIALOG CREATE,Register this software,-1,0,356,363
  rem Be sure to give the browser element the NONAVIGATE style.
  DIALOG ADD,BROWSER,BROWSER1,5,5,345,353,about:blank,,NONAVIGATE
  DIALOG SHOW

rem Make sure the variable we are going to use to put the HTML code in, is empty.
%x =
rem You always have to add the "onContextMenu='return false;' text to the <body> tag, to
rem prevent users from viewing the source of your page.
%x = %x"<body background='http://cusveller.nl/afbeeldingen/Watermerk_02.jpg' onContextMenu='return false;'>"
rem Just like with normal HTML pages, you can just specify CSS styles to your document.
%x = %x" <style>input,select{font-family: Verdana; font-size: 10 px; color: red; border: 1 solid #000000;}</style>"
%x = %x" <style>table{font-family: Verdana; font-size: 10 px;}</style>"
rem When creating a form, be sure to ALWAYS add the action='' and method='get' parameters.
rem Make sure the action='' parameters begins with <name>:, because otherwise the form
rem won't seem to send the value of the fields to VDS.
%x = %x"  <form action='form:' method='get'>"
rem We will display the form fields in a table, so they are aligned real nice.
%x = %x"   <table width='100%'>"
%x = %x"    <tr> <td colspan='2'><b>Please fill out the form below to complete your registration.</b></td></tr>"
%x = %x"    <tr> <td>Name</td>    <td><input type='text' name='frmName'></td>     </tr>"
%x = %x"    <tr> <td>Address</td> <td><input type='text' name='frmAddress'></td>  </tr>"
%x = %x"    <tr> <td>ZIP</td>     <td><input type='text' name='frmZIP'></td>      </tr>"
%x = %x"    <tr> <td>City</td>    <td><input type='text' name='frmCity'></td>     </tr>"
%x = %x"    <tr> <td>Phone</td>   <td><input type='text' name='frmPhone'></td>    </tr>"
%x = %x"    <tr> <td>E-mail</td>  <td><input type='text' name='frmEmail'></td>    </tr>"
%x = %x"    <tr> <td>Payment</td> <td><select size='1' name='frmPayment'><option selected>with cash</option><option>by bank</option><option>by creditcard</option></select></td></tr>"
%x = %x"    <tr> <td>&nbsp;</td>  <td><input type='submit' value='Register'></td> </tr>"
%x = %x"   </table>"
%x = %x"  </form>"
%x = %x"</body>"

rem Now just load the contents of %x into the browser element.
dialog set,browser1,%x
 
:Evloop
wait event
goto @event()

:Browser1navigate
rem First, capture the URL and put it into a variable.
%%navURL = @browser(browser1,navURL)
rem Now use the @ParseURL() function to get the values of the
rem input fields.
%%frmName    = @ParseURL(%%navURL,frmName)
%%frmAddress = @ParseURL(%%navURL,frmAddress)
%%frmZIP     = @ParseURL(%%navURL,frmZIP)
%%frmCity    = @ParseURL(%%navURL,frmCity)
%%frmPhone   = @ParseURL(%%navURL,frmPhone)
%%frmEmail   = @ParseURL(%%navURL,frmEmail)
%%frmPayment = @ParseURL(%%navURL,frmPayment)
rem Now do something with these values. You can do things like putting it into a
rem INI file, do some calculations with it or display some results.
info Hello %%frmName from %%frmAddress"," %%frmZIP %%frmCity. Should I phone you at %%frmPhone or send you an E-mail at %%frmEmail? You are going to pay %%frmPayment.
goto Evloop

:Close
exit

:ParseURL
rem Use this function like:
rem - @ParseURL(<source string>,<formfieldname>)
if @greater(@pos(%2,%1),0)
  if @equal(@substr(%1,@sum(@len(%2),@pos(%2,%1),1),@sum(@len(%2),@pos(%2,%1),1)),"&")
    exit
  end
  %1 = @substr(%1,@sum(@pos(%2,%1),@len(%2),1),@len(%1))
  if @greater(@pos("&",%1),0)
    %1 = @substr(%1,1,@pred(@pos("&",%1)))
  end
  while @greater(@pos("+",%1),0)
    %%HexPos = @pos("+",%1)
    %1 = @strdel(%1,%%HexPos,%%HexPos)
    %1 = @strins(%1,%%HexPos," ")
  wend
  while @greater(@pos("%",%1),0)
    %%HexPos = @pos("%",%1)
    %%Ascii = @chr(@sum($@strdel(@substr(%1,%%HexPos,@sum(%%HexPos,2)),1),0))
    %1 = @strdel(%1,%%HexPos,@sum(%%HexPos,2))
    %1 = @strins(%1,%%HexPos,%%Ascii)
  wend
  exit %1
end
exit

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sun Feb 06, 2005 4:46 pm    Post subject: Reply with quote

Nice, Skit3000!

Your creativity never rests... Cool

Cheers,

- Boo
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Feb 07, 2005 7:51 am    Post subject: Reply with quote

that is so cool!!!

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Feb 09, 2005 8:10 am    Post subject: Reply with quote

been playing with your code skit and am looking at the form information to be sent to me by using

Code:
shell open, mailto:support"@"cattle-ramp-seo.com?subject=Keywords Analysis Registration&body=%%frmName%%frmCity%%frmEmail


any idea how i can separate the body text so that each variable is on a separate line?

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Feb 09, 2005 1:27 pm    Post subject: Reply with quote

Try putting "<br>" between the variables, or search for the HEX code of a @cr() (I don't know it from the head Smile) and put that one between the variables... Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Feb 09, 2005 2:37 pm    Post subject: Reply with quote

thanks skit but i have no idea how to get the hex of @cr() Crying or Very sad

is that all i need?

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Feb 09, 2005 3:59 pm    Post subject: Reply with quote

There should be some URI encoding and decoding code on the main
site somewhere.

Tommy and I worked on code for this years ago for cgi programs made
in VDS.

-Garrett

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Wed Feb 09, 2005 4:03 pm    Post subject: Reply with quote

Serge,
The URL encoded hex value for @cr() is %0D and the hex value for @lf() is %0A. You can find these at
http://www.dwfaq.com/Tutorials/Miscellaneous/special_links_encoding.asp
If your not sure then put the character in a @Hex(@asc(@tab()),2) or @Hex(@asc(|),2) and stick a % sign infront of it and now you have a URL encoded hex value like the code below.

Code:
%A = "%"@Hex(@asc(@tab()),2)
Info %A

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Feb 10, 2005 8:05 am    Post subject: Reply with quote

cool, guys Very Happy Very Happy Very Happy

i finally worked it out with the help of your link dragonsphere where they had an example of a new line

the final code is like this,

Code:
shell open, mailto:support"@"cattle-ramp-seo.com?subject=Keywords Analysis Registration&body=%%frmName"%"0a%%frmCity"%"0a%%frmEmail_1"%"0a%%frmEmail_2


the line feed code is %0a and it seems crucial that there not be any spaces before or after %0a

thanks garrett and dragonsphere

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Knowledge Base All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group