Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Javascript problem

 
Post new topic   Reply to topic    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
vstapic



Joined: 15 Nov 2011
Posts: 2
Location: Croatia

PostPosted: 15.11.2011 19:27    Post subject: Javascript problem Add user to your forum ignore list Reply with quote

Molio bi malu pomoć ... googlao sam na ovu temu ali nisam rješio problem ...

situacija je sljedeća .. dakle trebam iz jednog polja (input) u drugo dobiti dio teksta (točije zadnjih par znakova) ... e sad pošto nemam iskustva s pisanjem javascrpita zapeo sam

Ovako to izgleda ... na KeyUp objekta se poziva funkcija koja je sporna

function funx(){
var kom = document.getElementById('naziv_polja_1').value;
document.getElementById('naziv_polja2').value = kom.substring(kom.length - 5,kom.length);
}

To gore je naravno ideja koja neradi ... pa Vas molim za pomoć ...

Zahvaljujem unaprijed
Back to top
View user's profile Send private message
hrvoje_86



Joined: 06 Dec 2006
Posts: 107
Location: Zagreb

PostPosted: 15.11.2011 20:51    Post subject: Re: Javascript problem Add user to your forum ignore list Reply with quote

vstapic wrote:


To gore je naravno ideja koja neradi ... pa Vas molim za pomoć ...

Zahvaljujem unaprijed

Meni radi.
Barem u firefoxu.

Code:
<!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>
    <title></title>
</head>
<body>
<input id="polje1" type="text" value="12345678910"/>
<input id="polje2" type="text" value=""/>
<button onclick="funx()" >funx</button>
<script type="text/javascript">
    function funx() {
        var kom = document.getElementById('polje1').value;
        document.getElementById('polje2').value = kom.substring(kom.length - 5, kom.length);
    }
</script>
</body>
</html>

I zašto ne koristiš jquery?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
vstapic



Joined: 15 Nov 2011
Posts: 2
Location: Croatia

PostPosted: 16.11.2011 09:25    Post subject: Add user to your forum ignore list Reply with quote

Hvala na odgovoru ... to je ono kad gledaš u nešto sat vremena i ne vidiš ništa ...

trebalo je davno na pauzu Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    mi3dot.org Forum Index -> Client-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group