Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [Javascript]
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Napolux
-29 Kg da Settembre 2005

User info:
Registered: Jun 2002
Posts: 3666 (0.42 al dì)
Location: Giussano (MI)
Corso: F28
Anno: ???
Time Online: 21 Days, 19:29:36 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[Javascript]

Ciao a tutti...

Dovrei fare una cosa del genere:

- Inserire un testo in una textarea
- Selezionare parte del testo
- A questo testo selezionato aggiungere all'inizio e alla fine una @ premendo un bottone.

Fino al bottone ci arrivo, al click faccio eseguire una funzione, ma le @ vengono messe alla fine della textarea...

Come fare per metterle all'inizio e alla fine del testo *selezionato* ???

__________________
Napolux.com

20-10-2005 20:10
Click Here to See the Profile for Napolux Click Here to See the Blog of Napolux Click here to Send Napolux a Private Message Visit Napolux's homepage! Find more posts by Napolux Add Napolux to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
0m4r
.grande:maestro.

User info:
Registered: Mar 2002
Posts: 7287 (0.84 al dì)
Location: Düsseldorf (DE)
Corso:
Anno: ESAMI FINITI
Time Online: 49 Days, 0:57:33 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

scusa, io non so darti una risposta... ma non riesci a dare un occhiata a come funzionano le form dei forum (oviamente quelli che te lo permettono)???

è un'idea... scusa se non è la risposta che cercavi...

__________________
http://www.twitter.com/0m4r

20-10-2005 20:38
Click Here to See the Profile for 0m4r Click Here to See the Blog of 0m4r Click here to Send 0m4r a Private Message Find more posts by 0m4r Add 0m4r to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.20 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ho usato un pò javascript qualche tempo fa e per quel che mi ricordo non mi sembra una cosa fattibile, poichè credo che la selezione del testo sia esterna a javascript stesso, ma gestita dall'interfaccia grafica.

Nessuna garanzia però :)

__________________
?

20-10-2005 23:03
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Napolux
-29 Kg da Settembre 2005

User info:
Registered: Jun 2002
Posts: 3666 (0.42 al dì)
Location: Giussano (MI)
Corso: F28
Anno: ???
Time Online: 21 Days, 19:29:36 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by 0m4r
scusa, io non so darti una risposta... ma non riesci a dare un occhiata a come funzionano le form dei forum (oviamente quelli che te lo permettono)???

è un'idea... scusa se non è la risposta che cercavi...


si' ho provato, ma vorrei capire per bene come funziona, non fare copia e incolla...

che poi non funziona sempre...

__________________
Napolux.com

21-10-2005 10:23
Click Here to See the Profile for Napolux Click Here to See the Blog of Napolux Click here to Send Napolux a Private Message Visit Napolux's homepage! Find more posts by Napolux Add Napolux to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Io lo so fare con IE, ma purtroppo non conosco il modello selection di Firefox, quindi dubito che ti sia utile...

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

21-10-2005 11:42
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Napolux
-29 Kg da Settembre 2005

User info:
Registered: Jun 2002
Posts: 3666 (0.42 al dì)
Location: Giussano (MI)
Corso: F28
Anno: ???
Time Online: 21 Days, 19:29:36 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by ripe
Io lo so fare con IE, ma purtroppo non conosco il modello selection di Firefox, quindi dubito che ti sia utile...


Gia' IE sarebbe un passo avanti...

__________________
Napolux.com

21-10-2005 21:30
Click Here to See the Profile for Napolux Click Here to See the Blog of Napolux Click here to Send Napolux a Private Message Visit Napolux's homepage! Find more posts by Napolux Add Napolux to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ok, allora il codice - scritto in maniera moooolto sporca :D - è semplicemente questo:

code:
<script> function marcaSelezione() { var selezione = document.selection.createRange().text; if (selezione != "") document.selection.createRange().text = "@" + selezione + "@"; } </script> <input type="button" onClick="marcaSelezione()" value="Inserisci" /><br /> <textarea>Testo da selezionare</textarea>


Purtroppo non ho ancora sperimentato con Firefox, perché sulle selezioni in modello di Mozilla è ancora un pò fumoso... ;)

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

22-10-2005 11:02
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Hamelin
.pifferaio.magico.

User info:
Registered: Feb 2003
Posts: 662 (0.08 al dì)
Location: ..tra i monti intorno ad Hamelin..
Corso: Ingegneria Informatica
Anno:
Time Online: 7 Days, 7:19:55 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Più che il modello di Mozilla direi il DOM standard... o sbaglio?

__________________
Bjarne Stroustrup: "I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone."
Andrew S. Tanenbaum: "Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway."
Edsger Dijkstra: "Computer Science is no more about computers than astronomy is about telescopes."
Robert Firth: "One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs."
Donald Knuth: "A mathematical formula should never be 'owned' by anybody! Mathematics belong to God."

22-10-2005 11:25
Click Here to See the Profile for Hamelin Click here to Send Hamelin a Private Message Visit Hamelin's homepage! Find more posts by Hamelin Add Hamelin to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Hamelin
Più che il modello di Mozilla direi il DOM standard... o sbaglio?


Non so, il windows.getSelection() e document.getSelection() li hanno invertiti un pò di volte... comunque ho detto, non ci capisco nulla! :asd:

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

22-10-2005 11:44
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Napolux
-29 Kg da Settembre 2005

User info:
Registered: Jun 2002
Posts: 3666 (0.42 al dì)
Location: Giussano (MI)
Corso: F28
Anno: ???
Time Online: 21 Days, 19:29:36 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

deng iu!

__________________
Napolux.com

23-10-2005 09:58
Click Here to See the Profile for Napolux Click Here to See the Blog of Napolux Click here to Send Napolux a Private Message Visit Napolux's homepage! Find more posts by Napolux Add Napolux to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 19:52.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.123 seconds (60.02% PHP - 39.98% MySQL) con 25 query.