By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,453 Members | 3,225 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,453 IT Pros & Developers. It's quick & easy.

Autofilling in firefox

P: 25
Hi all,

How to do autofilling of a web form in firefox using javascript. ie through java script program should do autofilling of the web form.


Thanks
DNK2007
Jan 16 '08 #1
Share this Question
Share on Google+
18 Replies


gits
Expert Mod 5K+
P: 5,333
hi ...

what have you done so far? where/how do you get the values to fill in the form?

kind regards
Jan 16 '08 #2

P: 25
Hi

I need to fill the form details(username, password) from the java script.
Assume javascript uses static username, password.


thanks
DNK2007
Jan 16 '08 #3

gits
Expert Mod 5K+
P: 5,333
ok ... so you have a username and password stored in javascript variables? to set the value of an input-box that has an id you could use the following:

Expand|Select|Wrap|Line Numbers
  1. // we retrieve a reference to the input-element
  2. var input_box = document.getElementById('your_input_box_id');
  3.  
  4. // we set the value of the box
  5. input_box.value = 'whatever_value_you_have';
kind regards
Jan 16 '08 #4

P: 25
ok ... so you have a username and password stored in javascript variables? to set the value of an input-box that has an id you could use the following:

Expand|Select|Wrap|Line Numbers
  1. // we retrieve a reference to the input-element
  2. var input_box = document.getElementById('your_input_box_id');
  3.  
  4. // we set the value of the box
  5. input_box.value = 'whatever_value_you_have';
kind regards

Hi,

Its right if web page exists in the local box, but what about when a web page
is laoded by firefox which exists on remote server say gmail login page. How my program fill the login items?


thanks
DNK2007
Jan 16 '08 #5

gits
Expert Mod 5K+
P: 5,333
then we have a simple answer: you cannot cross-site-script for security-reasons ... you only may script for your own pages ...

kind regards
Jan 16 '08 #6

P: 25
then we have a simple answer: you cannot cross-site-script for security-reasons ... you only may script for your own pages ...

kind regards
Hi

But what about firefox builtin password manager which fills the username, password automatically. It fills the fields when web page is loaded and also so many commercial software exists in the market that provide this feature. I want my program to do this operation. Is there any other language from which we can achive this?


Thanks
DNK2007
Jan 17 '08 #7

gits
Expert Mod 5K+
P: 5,333
you may play araound with the FF/Mozilla LoginManager but since i don't know about that yet you should investigate that from there. another way would be a serverside proxy ... so you could make the requests from your server, copy the page and send it to the user so that it comes from your own domain ... that could be done with the serverside language you prefer ...

kind regards
Jan 17 '08 #8

P: 25
you may play araound with the FF/Mozilla LoginManager but since i don't know about that yet you should investigate that from there. another way would be a serverside proxy ... so you could make the requests from your server, copy the page and send it to the user so that it comes from your own domain ... that could be done with the serverside language you prefer ...

kind regards
Hi,

U said about another way ie server side proxy. Hw it is done? can u explain me in detail? Another question - how about editing the source code of the loaded page and reloading it? Any solutions for this question?

Thanks
DNK2007
Jan 17 '08 #9

gits
Expert Mod 5K+
P: 5,333
... you only can do that serverside ... that server has to request the page. then you may write (copy) that page through parsing the source-code of it ... may be here you could change the page ... now deliver YOUR recently written page (that is an adapted copy of the requested page) where you could do whatever you want ... :)

what do you mean with edit the source-code ... let the user edit it? the currently loaded page?
Jan 17 '08 #10

P: 25
... you only can do that serverside ... that server has to request the page. then you may write (copy) that page through parsing the source-code of it ... may be here you could change the page ... now deliver YOUR recently written page (that is an adapted copy of the requested page) where you could do whatever you want ... :)

what do you mean with edit the source-code ... let the user edit it? the currently loaded page?
Hi,

We can get the source code of the loaded page right? By parsing the file for username, password field we can set the values.


Thanks
DNK2007
Jan 17 '08 #11

gits
Expert Mod 5K+
P: 5,333
could you give an example for that :) ... how would you retrieve the source of a loaded page from another domain ... i think you cannot do that with javascript
Jan 17 '08 #12

P: 25
could you give an example for that :) ... how would you retrieve the source of a loaded page from another domain ... i think you cannot do that with javascript
Hi

I thought it is possible to get the source of the webpage from javascript. I am new to java script. If we get source in some other way is it possible to do the autofilling by editing the source and reloading the webpage?


Thanks
DNK2007
Jan 17 '08 #13

gits
Expert Mod 5K+
P: 5,333
as i said ... not with javascript ... you may do a serverside trick ... let your server request the page and handle it as i mentioned above ...

kind regards
Jan 17 '08 #14

P: 25
as i said ... not with javascript ... you may do a serverside trick ... let your server request the page and handle it as i mentioned above ...

kind regards

Hi gits,

Thanks for ur valuable solutions. Any way I will be back if I found difficult in this.

Thanks
DNK2007
Jan 21 '08 #15

P: 25
Hi gits,

Is it possible for us to do autofilling from client machine not from server or some other intermediate machine?


Thanks
DNK2007
Jan 23 '08 #16

gits
Expert Mod 5K+
P: 5,333
hi ...

i only could repeat what was said already: everything you do with javascript is relativly strictly bound to your own pages ... and i case you find a way for one browser (may be you could use Mozilla's LoginManager, or write your own extension, or something like that) ... you have probably to find another way for other browsers ...

kind regards
Jan 23 '08 #17

P: 25
hi ...

i only could repeat what was said already: everything you do with javascript is relativly strictly bound to your own pages ... and i case you find a way for one browser (may be you could use Mozilla's LoginManager, or write your own extension, or something like that) ... you have probably to find another way for other browsers ...

kind regards
Hi gits,

Sorry for asking the same question again and again. How about perl or php? will they support for client side scripting of the loaded webpage?

Thanks
DNK2007
Jan 23 '08 #18

gits
Expert Mod 5K+
P: 5,333
?? php, perl, asp, jsp, asp.net etc. are serverside-scripting languages ... you cannot use it at the clientside in an webapplication ...
Jan 23 '08 #19

Post your reply

Sign in to post your reply or Sign up for a free account.