Re: Get value from button
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Get value from button

From: Daniel Kirsch <Iwillnotread_daniel@gmx.de>
Date: Mon Jun 20 2005 - 16:25:40 CEST

bonAveo.net wrote:
> Hi, I got 3 buttons with 3 different values...
>
>
>> <input type="image" src="search.png"
>> value="http://jigsaw.w3.org/css-validator/validator?usermedium=all&uri="
>> onclick="addUrl(this.value)"> <input type="image" src="search.png"
>> value="http://validator.w3.org/check?uri="
>> onclick="addUrl(this.value)"> <input type="image" src="search.png"
>> value="http://validator.w3.org/checklink?hide_redirects=on&hide_type=all&recursive=on&depth=1&check=Check&uri="
>> onclick="addUrl(this.value)">

where is your addUrl function?

You may probably want something like

function addUrl(val) {
   document.getElementById("seee").value += val;
}

>> function goTo() {
>>
>> var adress = document.getElementById("seee");

I don't see an element with ID "seee"

>> var link = document.getElement("addUrl");

I don't see an element with ID "addUrl"

>> var url = link + adress;

"link" and "adress" are object references in this case. If they
reference a button, you need to get their values:

var url = link.value + adress.value;

Daniel
Received on Tue Oct 18 02:46:32 2005