You can do it, but it will definitely not be the easiest way to achieve the objective. The accessibility of your web form will determine what you can and can not do.
The first issue would be populating the field of the form, and that can be achieved by actually re-generating the form programmatically and assigning a value to the html value tag for that field.
The second issue of "click on the button" is not trivial. If you're in the windows environment you will have to get into intercepting windows messages from the message queues and get the handle of the web browser window and after finding all the relevant information that will change every time this process is performed, is in my opinion not worth the effort.
I would approach this di
fferently in looking at what you are trying to achieve in the first place and that is to do directly with the data what the form would've done.
Forms will either send some e-mail to someone using the submitted data or submit information to a database or write it to a file. If you have a cgi script behind the form you can pass the information directly to the script rather, i.e call the scrip directly in the same way the form would've using your program and skip the form.
If you can be specific about your objectives and give me details about the forms and detail on the web server type and the capabilities of handling various types of cgi scripts I can give you detailed advice and pointers towards achieving the solution.
Questions you need to answer:
- What would the form do with the data? (mail, file, database etc.)
- How many fields do you need to submit?
- What type of web server are you running? (IIS, Apache etc.)
- Were is the form hosted, on the www
or on an intranet?
- Is it accessible to you to change/add scrips to it?
Hope this helps.
Best regards
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd