Call javascript function with an href -


i'm developing website, i'm not expert when comes javascript. i'm using script found on internet searching page text string. call function use following code:

  <div class="pesquisa" id="pesquisa"><form name="f1" action=""   onsubmit="if(this.t1.value!=null && this.t1.value!='')   findstring(this.t1.value);return false">   <input name="t1" type="text" /></form>   </div> 

this working well, when enter text , click enter finds on page. have "button" next represented by:

<a href='javascript:document.f1.findstring(this.t1.value)'> <div class="enviar" id="enviar">pesquisar</div></a></div> 

i want "button" call same function value inserted in form. not working way. ideas on how can made ?

thanks in advance, cláudio

try this.. add id attribute t1 (also called "t1"), , reference this:

<a onclick="javascript:findstring(document.getelementbyid('t1').value)"> 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -