samanthmarisetty
Programmer
Hi,
I am new to javascript and I wanted to know if it is possible to call java script function from a href of anchor tag.
I am doing the following in the function
<SCRIPT LANGUAGE="JavaScript">
function getString (form) {
var TestVar = "/app/sched/registration.action?username=";
var val = form.username.value;
TestVar = TestVar+val;
return TestVar;
}
<a href="getString(this.form)">1st Time User</a>
but I do not get the desired result. Is there anything that I am missing?
Please help me.
Thanks,
Samanth.
I am new to javascript and I wanted to know if it is possible to call java script function from a href of anchor tag.
I am doing the following in the function
<SCRIPT LANGUAGE="JavaScript">
function getString (form) {
var TestVar = "/app/sched/registration.action?username=";
var val = form.username.value;
TestVar = TestVar+val;
return TestVar;
}
<a href="getString(this.form)">1st Time User</a>
but I do not get the desired result. Is there anything that I am missing?
Please help me.
Thanks,
Samanth.