Jump to content
Sign in to follow this  
NirKlieman

Form data is not saved

Recommended Posts

NirKlieman

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

Share this post


Link to post
Share on other sites
Jos

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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
NirKlieman

Jos

 

 

Yes, I have submit button on which I press to save the form.

 

I think the key for the problem is somthing the IE - When I opened the console mode of the IE, I see that none of the new values is sent via the confirm button.

Share this post


Link to post
Share on other sites
232showtime

if i were you I will post my script so i can get help from the expert coder... :D:D:D


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites
NirKlieman

Thanks all.

 

The same behavior repeats when I used  danyhack  code.

 

Any more suggestions?

Does anyone saw similiar bahvior on IE 10 ?

Share this post


Link to post
Share on other sites
NirKlieman

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)

 

Share this post


Link to post
Share on other sites
NirKlieman

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 !!

Share this post


Link to post
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
Sign in to follow this  

×