...

View Full Version : "pass arguments"



urgido
11-07-2006, 09:20 AM
Hello,

I have 10 web links on my index but at the top my page is there one <input type="text" name="myurls"> So I want to create an effect like the following:

<a href="http://www.yahoo.com">Yahoo!</a> <a href="#">click add</a>

When some user press to the "click add" link the url link http://www.yahoo.com is passed on <input type="text" name="myurls"> and if the same user click on other link the present link disappears and the new is writing.

Regards and thanks for all help/helpers.:thumbsup:

Mr J
11-07-2006, 09:48 AM
You could try something llike this


<script type="text/javascript">

function addUrl(v){

document.forms["myform"]["myurls"].value=document.getElementById(v).href

return false

}

</script>

<a id="lnk1" href="http://www.yahoo.com">Yahoo!</a> <a href="#" onclick="return addUrl('lnk1')">click add</a>
<BR>
<a id="lnk2" href="http://www.codingforums.com">Codingforums.com</a> <a href="#" onclick="return addUrl('lnk2')">click add</a>

<form name="myform">
<input type="text" name="myurls" style="width:200px">
</form>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum