document.getElementsByName( 'sub' )[0].disabled = true;
To zablokuje submita.
@UP
piotrooo89 takim sposobem robi się lekki bajzel w kodzie lepiej robić to dynamicznie
javascript nextsibling
<script type="text/javascript">
function insertAfter( referenceNode, newNode )
{
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}
function request( object, file )
{
var oD = document.createElement( 'div' );
insertAfter( object, oD );
advAJAX.get({
url: file,
mimeType: 'text/html',
onSuccess : function(obj)
{
oD.innerHTML = obj.responseText;
}
});
object.setAttribute( 'onclick',"" );// special 4 IE
}
<a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'a.txt' );">Click me 2 get text from A file
</a><br /> <a href="javascript:void(0);" onclick="javascript:request( this, 'b.txt' );">Click me 2 get text from B file
</a><br />
Przykład wklejam bo nie mogłem znaleść adresu na który to wrzuciłem.