Jump to content

Form data is not saved


Recommended Posts

Hi all,

I'me pretty new on AutoIT world so forgive if the following question was answered before.

 

I want my AIT script to update a text-field on a specific html page of web-site:

therfore I login the site and when I enter the relevant section, I update the field by the following code:

 

$oFrame = _IEFrameGetCollection($oIE, 1)

$emailElement = _IEGetObjByName($oFrame, "default_cli")

_IEFormElementSetValue($emailElement, "myDefault CLI")

 

No error is returned, and I actually see that the relevant textbox is updated. But when I submit the page, the data is not saved - when I enter the page again I see that the data was not modified.

I'me using IE10 and when I try to use the 'Console mode' (F12) I see that the old data is sent with the submit.

 

The same behvaior happend with all sort of input (select etc).

 

Please help me,

Thanks

 

Nir

Link to comment
Share on other sites

  • Developers

There isn't enough info here to be able to help you.
What do you normally need to do after typing the new value in the field? Press a button on the form to save?

Jos

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

i think that you can risolve with this:

$oFrame = _IEFrameGetCollection($oIE, 1)
$emailElement = _IEGetObjByName($oFrame, "default_cli")
_IEAction($emailElement, 'focus')
Sleep(500)
_IEPropertySet ( $emailElement, "innertext", "myDefault CLI")

god bless you!

Link to comment
Share on other sites

Probably referring to this.

​Yes Danp2,

 when I used 

$oFrame = _IEFrameGetCollection($oIE, 1)
$emailElement = _IEGetObjByName($oFrame, "default_cli")
_IEAction($emailElement, 'focus')
Sleep(500)
_IEPropertySet ( $emailElement, "innertext", "myDefault CLI")

The same behaviot happenes ( I saw the lines updated but the site didn't save the data)

 

Link to comment
Share on other sites

OK, I solve it.

The problem was somthing about Knockout code which were behind the page and prevents  third party programs (such as the AutoIT) to change the input. The key is to use 'execscript'.

The working code is: 

   $command = "top.main_frame.window.viewModel.default_cli('" & "myDefault CLI" & "');"
   $oIE.document.parentwindow.execscript($command)



Thanks for all of you !!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...