Pseudo-protocol and changing pages

O

oldrich.svec

Hi,
I know it is possible to put into address bar some code like
"javascript:GetElementById("name").value=Something" and it will try to
find ID name on the page I am right now and change it. Is it possible
to put this feature into a link? For example, if I click on link
targeting to gmail it will automaticly fill in name and pass on gmail
for me.
Thanks for help
Olda
 
C

chOP

Olda,

Yes, you certainly can do something like this. Use the 'onclick'
attribute of the A tag to do something like this:

<INPUT type="text" id="name" />
<A href="mailto:[email protected]"
onclick="document.location=this.href+'?subject=email%20from%20'+document.getElementById('name').value;return
false;">email me</A>

Hope this helps
chOP
 
R

Randy Webb

chOP said the following on 12/14/2006 11:54 PM:
Olda,

Yes, you certainly can do something like this. Use the 'onclick'
attribute of the A tag to do something like this:

<INPUT type="text" id="name" />
<A href="mailto:[email protected]"
onclick="document.location=this.href+'?subject=email%20from%20'+document.getElementById('name').value;return
false;">email me</A>

Why abuse a link? Just make it a button. Why do people make this crap
harder than it has to be?
 
O

oldrich.svec

Thanks for the answer but that is not I ment. I wanted to login to
gmail automaticly.. not to send email ;) I have found out that due to
security reasons it is not allowed to change external pages like google
etc. So I will have to find different way. Thanks anyway ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top