473,385 Members | 1,958 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,385 software developers and data experts.

how to append to URL ?

user input accepted via a input in the form.
this value needs to be appended to the current url (explained
below)

ie say present url is www.xyz.com and the user is asked
to enter his string and say he enters "john"
a hyper link needs to be created by appending this string, like
<a href="http://www.xyz.com/john"></a>
(the string "john" was the one input by the user in the input
field)
(where www.xyz.com is the current url)

it is easy to extract the value of the input field entered by the user
like document.forms[0].name1.value

how to use this value and append to the current url and then create a
new hyperlink with this appended string ?
Jul 20 '05 #1
2 26741
This may help:-
http://artlung.com/lab/scripting/change_all_links/

this is to change all links, but if you know the position of th elink on
your page you can just use it's 'i' number.

Stu

"brian" <br*********@yahoo.com> wrote in message
news:af**************************@posting.google.c om...
user input accepted via a input in the form.
this value needs to be appended to the current url (explained
below)

ie say present url is www.xyz.com and the user is asked
to enter his string and say he enters "john"
a hyper link needs to be created by appending this string, like
<a href="http://www.xyz.com/john"></a>
(the string "john" was the one input by the user in the input
field)
(where www.xyz.com is the current url)

it is easy to extract the value of the input field entered by the user
like document.forms[0].name1.value

how to use this value and append to the current url and then create a
new hyperlink with this appended string ?

Jul 20 '05 #2
like:-

<a href="/0">Blah0</a>
<script language="javascript">
function appendlink()
{
// Change 2nd link link item in array (3rd on page, arrays start at 0)
document.links[2].href= document.links[2].href + "/" +
document.test.string.value;
return false;
}
</script>

<form name="test" onsubmit="return(appendlink());">
<input type="text" name="string">
<input type="submit">
</form>

<a href="/1">Blah1</a><br />
<a href="/2">Blah2</a> << This will be chnaged<br />
<a href="/3">Blah3</a><br />
<a href="/4">Blah4</a><br />
<a href="/5">Blah5</a><br />
<a href="/6">Blah6</a><br />

"Stuart Palmer" <tr**********@youcant.com> wrote in message
news:JA****************@newsfep2-gui.server.ntli.net...
This may help:-
http://artlung.com/lab/scripting/change_all_links/

this is to change all links, but if you know the position of th elink on
your page you can just use it's 'i' number.

Stu

"brian" <br*********@yahoo.com> wrote in message
news:af**************************@posting.google.c om...
user input accepted via a input in the form.
this value needs to be appended to the current url (explained
below)

ie say present url is www.xyz.com and the user is asked
to enter his string and say he enters "john"
a hyper link needs to be created by appending this string, like
<a href="http://www.xyz.com/john"></a>
(the string "john" was the one input by the user in the input
field)
(where www.xyz.com is the current url)

it is easy to extract the value of the input field entered by the user
like document.forms[0].name1.value

how to use this value and append to the current url and then create a
new hyperlink with this appended string ?


Jul 20 '05 #3

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

Similar topics

9
by: cody | last post by:
Why isn't there an StringBuilder.Append() overload with a StringBuilder as argument? Is there a reason that I missed?
25
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
3
by: Jonathan Buckland | last post by:
Can someone give me an example how to append data without having to load the complete XML file. Is this possible? Jonathan
9
by: JMCN | last post by:
hi- i have inherited an access 97 database that keeps track of the loans. i have been running into referential intergrity problems when i try to append new loans to table. first of all is a...
1
by: David Barger | last post by:
Greetings, It appears that an Append Query I run in Access XP is randomly failing to append a field. I have payroll data being entered into a payroll database. This data is exported daily to...
5
by: Michael C via AccessMonster.com | last post by:
Hello, I have a table that I am appending 3 seperate tables into. My main problem is that each time I append the data, it simply adds to the data already there. That might sound ok, except that...
0
by: audleman | last post by:
I have an ASP form on my website where a visitor enters information. On submit, the form calls a stored procedure stores in a MS SQL 2000 database. The stored procedure works most of the time, but...
26
by: John Salerno | last post by:
If I want to create a list of the form (where each item is repeated twice after the first one), how might I do that most efficiently? Right now I have this: series = for x in range(10): ...
2
by: jeremito | last post by:
I have created a class that inherits from the list object. I want to override the append function to allow my class to append several copies at the same time with one function call. I want to do...
10
by: HYRY | last post by:
I have the following questions, I am using Python 2.4.2 19167152 #1 11306608 #1 1. the address of a.append and list.append is different, can I get the address of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.