PDA

View Full Version : form-submit with extjs button?



The_S
13 Jan 2010, 12:40 AM
Hi,

I'm new in extjs programming. I have to show the wikipedia search form with extjs buttons. The original wikipedia search form looks like this:


<a href="http://de.wikipedia.org" target="_blank">
<img src="/images/Wikipedia_240x60.png"
border="0" alt="wikipedia - die freie enzyklopädie" align="middle"
width="240" height="60" /></a>
<br /><br />
<form name="search" method="post"
action="http://de.wikipedia.org/wiki/Spezial:Suche" target="_blank">
<div align="left">
<input type="text" name="search" size="30" />
<br />
<br />
<input type="submit" id="go" value="Article" />
<input type="submit" id="fulltext" value="Search" />
</div>
</form>My extjs code looks like this:


<a href="http://de.wikipedia.org" target="_blank">
<img src="/images/Wikipedia_240x60.png"
border="0" alt="wikipedia - die freie enzyklopädie" align="middle"
width="240" height="60" /></a>
<br /><br />
<form name="search" method="post"
action="http://de.wikipedia.org/wiki/Spezial:Suche" target="_blank">
<div align="left">
<input type="text" name="search" size="30" />
<br />
<br />
<div id="article"></div>
<div id="sear"></div>
</div>
</form>

<script type="text/javascript">

Ext.onReady(function(){

var buttonObject1 = new Ext.Button({applyTo:'article',text:'Article',id:'go',type:'submit'});
var buttonObject2 = new Ext.Button({applyTo:'sear',text:'Search',id:'fulltext',type:'submit'});

});
</script>But if I press a button, nothing happend.

How can I fix it?

Thank you!