473,395 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Dynamic update of href.

Hi

I'm constructing a web page that previews data as it is entered by the
user. One of the fields is a link, and the user is entering the url
that will go in the href property. I'd like to update the href of the
previewed link as the user enters the url text. I.e. dynamically
update the href.
I can't see how to do this. Is it possible?
Assuming IE6.

Cheers

John South
Pangbourne UK

Nov 23 '05 #1
5 6387
JohnSouth wrote on 17 nov 2005 in comp.lang.javascript:
I'm constructing a web page that previews data as it is entered by the
user. One of the fields is a link, and the user is entering the url
that will go in the href property. I'd like to update the href of the
previewed link as the user enters the url text. I.e. dynamically
update the href.
I can't see how to do this. Is it possible?

<input onkeyup="z=document.getElementById('link');
z.innerHTML=z.href=this.value;" value='http://'>
<br>
<a href='http://' id='link'>http://</a>
Assuming IE6.


Why?

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 23 '05 #2
Hi Evertjan
That works!
I didn't know the href property was available. I suppose I should have
tried it.
I thought it may need IE 6 to work. Do you know if it will work with
other browsers?

Cheers

John South
Pangbourne UK

Nov 23 '05 #3
>> I'm constructing a web page that previews data as it is entered by the
user. One of the fields is a link, and the user is entering the url
that will go in the href property. I'd like to update the href of the
previewed link as the user enters the url text. I.e. dynamically
update the href.
I can't see how to do this. Is it possible?

<input onkeyup="z=document.getElementById('link');
z.innerHTML=z.href=this.value;" value='http://'>
<br>
<a href='http://' id='link'>http://</a>
Assuming IE6.


Why?


Here's a fun one :)

<input onkeyup="z=window.frames['page'].location.href=this.value;"
value='http://'>
<iframe width=100% height=90% name="page"></iframe>

Aaron
Nov 23 '05 #4
> Here's a fun one :)

<input onkeyup="z=window.frames['page'].location.href=this.value;"
value='http://'>
<iframe width=100% height=90% name="page"></iframe>


A new way to browse the web :)

Good for checking out new domain names. Should hook in DNS and ICANN as
well...

Food for thought,

Aaron
Nov 23 '05 #5
JohnSouth wrote on 17 nov 2005 in comp.lang.javascript:
Hi Evertjan
That works!
I didn't know the href property was available. I suppose I should have
tried it.
I thought it may need IE 6 to work. Do you know if it will work with
other browsers?


[please always quote on usenet, this is not email]

Other browsers, I suppose so. Try!

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: revolnip | last post by:
As attached is the code : <% Option Explicit dim lngTimer lngTimer = Timer %> <!--#include file="Connect.asp" --> <!--#include file="Settings.asp" --> <!--#include file="Common.asp" -->
3
by: JOSEPHINE ALVAREZ | last post by:
I have this code that I want to use to do a rollover. However, because the company I am doing it for is continually changing the text, I want to be able to use dynamic text to change the text on...
5
by: drdave | last post by:
Hi, I have 6 forms being generated using coldFusion, they are named special1, special2 special3 and so on.. in these forms I have a link to open a new window. I am trying to pickup the...
10
by: Iain | last post by:
Hi All My apologies if this appears to be simple to some of you but I have very little experience of javascript and I cannot work this one out, The code below is a nice piece of code I found...
3
by: brian.turner | last post by:
This is sort of a design/javascript question. It involves CSS rendering in dynamic areas of a page using IE. E 6 & 7 HI There, We've created some example static html pages (using CSS) that...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
7
by: Roarke | last post by:
Forgive me if this is too long/too simple - I am new to this! I have an htm page with a "post" form. This has 2 droplists, the variables of which are posted to a php page. This page queries a...
21
by: karen987 | last post by:
I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The...
3
by: jaddi1 | last post by:
Hi, I am trying to make a multi-level drop-down menu similar to what is seen here: http://www.cssplay.co.uk/menus/simple_vertical.html. My problem is that some of the menu will be populated from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.