Archived

This topic is now archived and is closed to further replies.

Autocompletion of Html Forms

This topic is 5008 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there any way to make like in php a script that would fill a form automatically? I had thought of maybe reading the contents of the html code (can be of course an php/asp generated page), then parse like the names of the variables and then pass em to the script referenced in the form action="script" method=post tag, but I guess that would be force brute or stupid. Is there any good way to accomplish this??

Share this post


Link to post
Share on other sites
Personally Im not interested at all in learning JavaScript (though I know Java well, so I guess I could learn as fast as hell), however, dya mean I can do it with it, but, in an easy way, like, if I take a crash course in that language I would be able to do it, or is it accomplished with some weird technique that Id probably will have to google for a long time.

Share this post


Link to post
Share on other sites
PHP is a server-side process that isn''t exposed to the client. If you are generating the HTML form via PHP, you might be able to find a way to fill out fields in the form (I have no specific information). JavaScript, OTOH, is integrated into the HTML DOM in virtually every browser, so it is trivial to alter the text property of any textual field, etc.

No, you don''t need to learn the actual language. You simply need to lookup some functions in a reference or refer to any of several sites with free scripts.

Share this post


Link to post
Share on other sites
It's trivial to have text boxes already filled out using PHP. For example,

<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<textarea><?=$text_to_put_in_textarea?></textarea>
<input type="text" value="<?=$stuff_to_put_in_text_box?>" />
<input type="submit" name="submit" value="<?=$button_text?>" />



But that's probably not what you're trying to do.

[edited by - teamonkey on March 20, 2004 7:37:11 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by teamonkey
But that''s probably not what you''re trying to do.



Yup, Im trying to do something like a "bot" that would fill a given form in X server with A,B,C...N given fields (that of course it would know beforehand)

Share this post


Link to post
Share on other sites
I have done some work in auto-completion and auto-update of HTML form fields. There is a paper available on how one can
program such a mechanism in Javascript. You can have a look at the paper here http://www.brics.dk/~sunil. Also have a look at the examples in the paper which can be found here http://www.brics.dk/~sunil/worldcupcon/ShowCase.html
There is also a compiler available that takes auto-completion specifications in a dialect of HTML and then interweaves with the form elements to generate the javascript code.

Getting back to your question, the idea is to model relationships among fields in a manner that ensures that the values can be deduced by this relationship alone. The question remains as to "when" and "how".

Lets take an example:
We have a form that contains three textual fields A,B,C with no default values ( for simplicity). Suppose the relationships
among the three fields is that A = B + C.
So, if I know A,B I can determine the value of C
similarly, if I know C,A I can determine the value of B
and also, given B,C I can determine tyhe value of A


This can be encoded as a kind of rule triggers based on what field values are known.
The "how" part can be encoded as function calls to a library.

Imagine what happens if I know all the three field values A,B and C. Well, I can almost certainly say either the three values
satisfy the relationship or not.......

I guess this is more advanced and complicated but I have given you the essential idea. Also, have a look at the examples. They are quite illustrative. Let me know if anything is unclear.

I hope that helps.
Sunil

Share this post


Link to post
Share on other sites