# Onclick works on IE Safari Chrome BUT NOT on Firefox!

**URL:** <https://forum.kirupa.com/t/onclick-works-on-ie-safari-chrome-but-not-on-firefox/304771>\
**Category:** Uncategorized\
**Created:** [February 13, 2010, 3:06pm UTC](https://forum.kirupa.com/t/onclick-works-on-ie-safari-chrome-but-not-on-firefox/304771 "2010-02-13T15:06:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![isk015](https://avatars.discourse-cdn.com/v4/letter/i/958977/32.png) [@isk015](https://forum.kirupa.com/u/isk015)\
**Post date:** [February 13, 2010, 3:06pm UTC](https://forum.kirupa.com/t/onclick-works-on-ie-safari-chrome-but-not-on-firefox/304771/1 "2010-02-13T15:06:56Z")

</div>

hi all, i am getting crazy here because this code bellow works fine in every major browser but not on Firefox.

What I am trying to do is really simple, when I click on a link I want to call a javascript function and pass the value of a field to that function. I tried several combinations and nothing. Here’s the test code:

```auto

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Click Here</title>

<script type="text/javascript">

function ftest(vars){
alert(vars);
}

</script>
</head>
<body>
<a href="javascript: ftest('field2.value')">Click Here</a> <br />
<br />
<input name="field1" id="field2" type="text" />
</body>
</html>

```
