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
JS i sadrzaj textareje... HITNO

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 30.09.2006 14:53    Post subject: JS i sadrzaj textareje... HITNO Add user to your forum ignore list Reply with quote

Znaci ovako, imam text areu i zelim sa javascriptom ispisati njenu vrijednost pritiskom na neki tipku... Mora biti klijentsko bas.. Sve ostalo znam... samo me zanima kako dobiti zajedno vrijednost html-a (textareje) i njezin unutarnji sadrzaj (tekst koji je upisan u nju)...
Hvala unaprijed...

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
dabac



Joined: 30 May 2006
Posts: 57

PostPosted: 30.09.2006 15:04    Post subject: Add user to your forum ignore list Reply with quote

f1 - name/id forme
t1 - name/id textaree

Ne znam mislis li na:

<button onClick="alert(document.getElementById('t1').innerHTML);">
<button onClick="alert(document.f1.t1.value);">
Back to top
View user's profile Send private message
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 30.09.2006 21:18    Post subject: Add user to your forum ignore list Reply with quote

Da, na to mislim... Samo bi trebao naraviti petlju koja ce alertirati klikom na gumb textove iz svih textarea... ustvari trebam petlju koja ce izvrsavati ovo:
string[n]=document.forma.text*.value;

ova zvjezdica (*) gore je zapravo n... Znaci prvi put ce ispisati samo text iz textaereje text1, slijedeci put iz text1 i text2 itd...
Kako to izvesti?...

Hvala unaprijed..

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 30.09.2006 23:11    Post subject: Add user to your forum ignore list Reply with quote

Aj pliz nek netko odgovori...

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
sinisa.kusic



Joined: 26 Jul 2005
Posts: 728
Location: Rijeka

PostPosted: 01.10.2006 08:45    Post subject: Add user to your forum ignore list Reply with quote

neznam napamet, ai neznam javascript baš toliko dobro.
Teoretski, trrebao bi petljom prvo proći kroz cijeli dokument, onda bi sa drugom petljom unutar prve trebao izdvojiti sve textarea sa getElementsByName ...

_________________
some are born awesome, some achieve awesomeness and some have awesomeness thrust upon them
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 01.10.2006 09:33    Post subject: Add user to your forum ignore list Reply with quote

Ima neko nes konkretno?

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 01.10.2006 09:34    Post subject: Add user to your forum ignore list Reply with quote

Jel mogu stavit ime neke varijable umjesto ime textboxa??

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
sinisa.kusic



Joined: 26 Jul 2005
Posts: 728
Location: Rijeka

PostPosted: 01.10.2006 09:46    Post subject: Add user to your forum ignore list Reply with quote

BlizZ wrote:
Ima neko nes konkretno?

imam, šljivu, lozu... što piješ

_________________
some are born awesome, some achieve awesomeness and some have awesomeness thrust upon them
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 01.10.2006 10:24    Post subject: Add user to your forum ignore list Reply with quote

Jel ima neka opcija u javascriptu koja će se fokusirati u određeni div i onda tamo samo dodati neki objekt poput diva ili tako nešto...
Pomagajte

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 01.10.2006 12:48    Post subject: Add user to your forum ignore list Reply with quote

preporucam ti da pogledas javascript library www.jquery.com jer ovo sto trazis vise nisu ful trivijalne stvari, i koristenje librarya ce ti puno pomoci

Quote:
Jel ima neka opcija u javascriptu koja će se fokusirati u određeni div i onda tamo samo dodati neki objekt poput diva ili tako nešto...


s jqueryem bi kod izgledao ovako
Code:
$('#id-tog-diva').append('<div id="ja-sam-novi-div">Evo div</div>');


izvrstna dokumentacija se nalazi na http://visualjquery.com/ a ukoliko ces trebati raditi kompleksnije kreiranje html elemenata preporucam it Easy dom creation plugin

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 01.10.2006 13:03    Post subject: Add user to your forum ignore list Reply with quote

Hvala puno, valjda budem uspio rjesit to sa jQuerijem...

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
dabac



Joined: 30 May 2006
Posts: 57

PostPosted: 12.10.2006 13:12    Post subject: Add user to your forum ignore list Reply with quote

BlizZ wrote:
Da, na to mislim... Samo bi trebao naraviti petlju koja ce alertirati klikom na gumb textove iz svih textarea... ustvari trebam petlju koja ce izvrsavati ovo:
string[n]=document.forma.text*.value;

ova zvjezdica (*) gore je zapravo n... Znaci prvi put ce ispisati samo text iz textaereje text1, slijedeci put iz text1 i text2 itd...
Kako to izvesti?...

Hvala unaprijed..


Sori ako kasnim, no ako je ovo jos aktualno:
Najlaksi nacin je ovo (ako si siguran koliko postoji textarea na formi i da su sve nazivane po redu, npr. od 1 do 10)

var br_textarea=xxx; /// ovdje zamijeni xxx sa brojem textarea
for (ii=1;ii<br_textarea+1;ii++) {
eval('output=document.forma.text'+ii+'.value;')
alert('text'+ii+': '+output);
}

Ovo je iz glave, javi ako ne radi
Back to top
View user's profile Send private message
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 12.10.2006 14:29    Post subject: Add user to your forum ignore list Reply with quote

dabac wrote:
BlizZ wrote:
Da, na to mislim... Samo bi trebao naraviti petlju koja ce alertirati klikom na gumb textove iz svih textarea... ustvari trebam petlju koja ce izvrsavati ovo:
string[n]=document.forma.text*.value;

ova zvjezdica (*) gore je zapravo n... Znaci prvi put ce ispisati samo text iz textaereje text1, slijedeci put iz text1 i text2 itd...
Kako to izvesti?...

Hvala unaprijed..


Sori ako kasnim, no ako je ovo jos aktualno:
Najlaksi nacin je ovo (ako si siguran koliko postoji textarea na formi i da su sve nazivane po redu, npr. od 1 do 10)

var br_textarea=xxx; /// ovdje zamijeni xxx sa brojem textarea
for (ii=1;ii<br_textarea+1;ii++) {
eval('output=document.forma.text'+ii+'.value;')
alert('text'+ii+': '+output);
}

Ovo je iz glave, javi ako ne radi


Thnx, rješeno je sa PHP-om, nije mi trebala javascript...

Last edited by Tristan on 12.10.2006 15:10; edited 1 time in total

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 12.10.2006 15:08    Post subject: Add user to your forum ignore list Reply with quote

Ako još jednom kažeš "Java" doći ću ti doma sa dva crnca, kombinirkama i letlampom Mad
Back to top
View user's profile Send private message Send e-mail Visit poster's website
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 12.10.2006 15:09    Post subject: Add user to your forum ignore list Reply with quote

Sulien wrote:
Ako još jednom kažeš "Java" doći ću ti doma sa dva crnca, kombinirkama i letlampom Mad


Pray TZAR!!1

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 12.10.2006 15:11    Post subject: Add user to your forum ignore list Reply with quote

Sulien wrote:
Ako još jednom kažeš "Java" doći ću ti doma sa dva crnca, kombinirkama i letlampom Mad


Sorry, frend mi cijelo vrijeme neš tupi za javascript i govori java... pa sam se zeznuo... Sad Sad

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 12.10.2006 17:03    Post subject: Add user to your forum ignore list Reply with quote

BlizZ wrote:
Sulien wrote:
Ako još jednom kažeš "Java" doći ću ti doma sa dva crnca, kombinirkama i letlampom Mad


Sorry, frend mi cijelo vrijeme neš tupi za javascript i govori java... pa sam se zeznuo... Sad Sad

onda ćemo poslat sulija frendu : ))

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
damir



Joined: 10 Jul 2004
Posts: 49

PostPosted: 12.10.2006 20:40    Post subject: Add user to your forum ignore list Reply with quote

BlizZ wrote:

Thnx, rješeno je sa PHP-om, nije mi trebala javascript...


zar nije trebalo bit rješeno na klijentu ?

_________________
pass the joint ...
Back to top
View user's profile Send private message Visit poster's website
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 12.10.2006 20:40    Post subject: Add user to your forum ignore list Reply with quote

maratz wrote:
BlizZ wrote:
Sulien wrote:
Ako još jednom kažeš "Java" doći ću ti doma sa dva crnca, kombinirkama i letlampom Mad


Sorry, frend mi cijelo vrijeme neš tupi za javascript i govori java... pa sam se zeznuo... Sad Sad

onda ćemo poslat sulija frendu : ))


Ne, suli će doć kod frenda sa crncima... Sam reci kad krećeš da ti pošaljem adresu...

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 12.10.2006 20:41    Post subject: Add user to your forum ignore list Reply with quote

damir wrote:
BlizZ wrote:

Thnx, rješeno je sa PHP-om, nije mi trebala javascript...


zar nije trebalo bit rješeno na klijentu ?


Na početku da, no na kraju sam skužio da nije potrebno... Smile Smile

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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