Secure webform - has form name Wont work.

Discuss the webviewer components of the MBS plugin.

Re: Secure webform - has form name Wont work.

Postby MonkeybreadSoftware » Fri Jun 25, 2010 8:10 am

I loaded this website into our Form Utility and it shows the form with index 0 and name "frmMain". Using quotes in the html is only needed if the name contains some special characters like spaces.

A common problem in this case is, that the website is not directly loaded, but loaded inside an IFrame or normal Frame.

For me it works. I'll email you my test database. Basicly it is just this line:

MBS( "WebView.SetFormInputValue" ; "web"; "frmMain"; "t_y_dealercode"; "Hello" )

The webviewer is named web, the URL is hard coded (you need to change) and it puts Hello in the dealer field in the form.

Greetings
Christian
Over 30000 functions in 1400 classes in one plugin collection.
The Monkeybread Software Realbasic Plugins.
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

Watch our REALbasic podcast in iTunes or on our website.
MonkeybreadSoftware
 
Posts: 88
Joined: Wed Sep 19, 2007 9:51 am

Re: Secure webform - has form name Wont work.

Postby arminecu » Fri Jun 25, 2010 9:27 am

The webviewer is set to a login page

first i login using the script
then the second script sets webviewer to the appropriate url then i set the variables after 4 seconds

how do i make the website url relative?
Thank you for all of your help.
arminecu
 
Posts: 9
Joined: Mon Jun 14, 2010 11:29 am

Re: Secure webform - has form name Wont work.

Postby MonkeybreadSoftware » Fri Jun 25, 2010 1:01 pm

relative?

Greetings
Christian
Over 30000 functions in 1400 classes in one plugin collection.
The Monkeybread Software Realbasic Plugins.
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

Watch our REALbasic podcast in iTunes or on our website.
MonkeybreadSoftware
 
Posts: 88
Joined: Wed Sep 19, 2007 9:51 am

Re: Secure webform - has form name Wont work.

Postby arminecu » Mon Jun 28, 2010 4:25 am

I get an error in the customer dialogue box "[MBS] Failed to find input Field"

I have sent you an e-mail, please let me know if you will be available.

Thank you for everything Christian.
arminecu
 
Posts: 9
Joined: Mon Jun 14, 2010 11:29 am

Re: Secure webform - has form name Wont work.

Postby MonkeybreadSoftware » Mon Jun 28, 2010 8:18 am

Okay, we solved it. Problem is that SetInputFormValue does not work for frames and you need to use javascript like this:

MBS( "WebView.RunJavaScript"; "browser"; "parent.frames[1].frames[1].document.frmMain.t_y_dealercode.value='hello';" )

So here we take the parent document, walk to the second frame (indexes start with 0 for first frame), inside that frame we pick again the second one. Now we pick the document inside the frame, there the form named "frmMain" and inside the form the field "t_y_dealercode". There we set the value to hello.

Seems to be difficult, but can be easier if you use DOM inspector in Firefox or Safari. Be aware that all names are case sensitive.

Greetings
Christian
Over 30000 functions in 1400 classes in one plugin collection.
The Monkeybread Software Realbasic Plugins.
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

Watch our REALbasic podcast in iTunes or on our website.
MonkeybreadSoftware
 
Posts: 88
Joined: Wed Sep 19, 2007 9:51 am

Re: Secure webform - has form name Wont work.

Postby sidcam » Sun Aug 01, 2010 11:05 pm

I have iFrame problems as well.

Using your example above, I made this work:

MBS( "WebView.RunJavaScript"; "HBMbrowser"; "parent.frames[1].document.form1.fldCoFirstName.value='hello';" )

But instead of filling the field with "hello" I need to pass through a database field (Contact Management::Name_First) and everything I've tried has failed. Is it possible to do it this way?

Also, using this example, how do I make it GET the data from the form?

Thanks in advance.
Sid
sidcam
 
Posts: 15
Joined: Wed Sep 19, 2007 9:52 am

Re: Secure webform - has form name Wont work.

Postby MonkeybreadSoftware » Mon Aug 02, 2010 1:37 am

Well I'd simply expect you call it like this:

MBS( "WebView.RunJavaScript"; "HBMbrowser"; "parent.frames[1].document.form1.fldCoFirstName.value='" & Contact Management::Name_First & "';" )

Not sure if you see it, but there are single quotes for javascript and double quotes for Filemaker.

To get the value, well, the cross platform way is to pass it back over the window title of the webviewer.

MBS( "WebView.RunJavaScriptReturnTitle"; "HBMbrowser"; "document.title=parent.frames[1].document.form1.fldCoFirstName.value;" )

and use the result.

Greetings
Christian
Over 30000 functions in 1400 classes in one plugin collection.
The Monkeybread Software Realbasic Plugins.
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

Watch our REALbasic podcast in iTunes or on our website.
MonkeybreadSoftware
 
Posts: 88
Joined: Wed Sep 19, 2007 9:51 am

Re: Secure webform - has form name Wont work.

Postby sidcam » Mon Aug 02, 2010 9:04 am

On your get function example, I'm confused.

Once JavaScript has passed the data from the form to the webviewer it needs to be place in the field "Contact Management::Name_First"

Is there a second function that takes the "document.title" data and places it into that field once it's captured?

Thanks
Sid
sidcam
 
Posts: 15
Joined: Wed Sep 19, 2007 9:52 am

Re: Secure webform - has form name Wont work.

Postby MonkeybreadSoftware » Mon Aug 02, 2010 9:53 am

Well, no second step needed.

You make a step in Filemaker script for "Set Field". There you specify the field in your database and in the value part you put the calculation there:

MBS( "WebView.RunJavaScriptReturnTitle"; "HBMbrowser"; "document.title=parent.frames[1].document.form1.fldCoFirstName.value;" )

So the javascript code puts the data in the document.title property and the plugin picks it there. This is a workaround as on Internet Explorer there is no way to directly return javascript results.

Greetings
Christian
Over 30000 functions in 1400 classes in one plugin collection.
The Monkeybread Software Realbasic Plugins.
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

Watch our REALbasic podcast in iTunes or on our website.
MonkeybreadSoftware
 
Posts: 88
Joined: Wed Sep 19, 2007 9:51 am

Previous

Return to WebView

Who is online

Users browsing this forum: No registered users and 1 guest

cron