janisetnies Posted November 16, 2006 Report Share Posted November 16, 2006 Tātad varbūt kāds var pastāstīt kā notiek pogas izveide, kas veic šādu funkciju: iezīmejot tekstu (iekš textbox) un uzspieržot uz pogas iezīmētā teksta sākumā parādas tags: <b> un beigās </b>!! Kā veido šadas pogas? Vajadzība ir pēc elementārākām pogām, BOLD, UNDERLINE, ITALIC, URL, COLOR, SIZE. (T.I līdzīgi kā forumos rakstot komentārus augšā ir izvēlnes josla ar kuru var koriģēt tekstu, bet vajag vienkārši, prosta! A. c. Jānis B. Link to comment Share on other sites More sharing options...
andrisp Posted November 16, 2006 Report Share Posted November 16, 2006 (edited) http://www.google.lv/search?hl=lv&q=ja...ection+textarea http://www.quirksmode.org/js/selected.html http://www.google.lv/search?hl=lv&q=ja...rea+bold+italic http://www.thecodebehind.com/code/javascri...-textareas.aspx That should be enough :). Edited November 16, 2006 by andrisp Link to comment Share on other sites More sharing options...
Delfins Posted November 16, 2006 Report Share Posted November 16, 2006 Blīīn, kā man apnik šie jautājumu, kad atbides ir te pat zem deguna.. PASKATIES SOURCI HTML TE PAT FORUMĀ, kad postē. Link to comment Share on other sites More sharing options...
janisetnies Posted November 16, 2006 Author Report Share Posted November 16, 2006 meiģināju no sources, bet spaidot pogu nekas nenotika, pazuda tikia iezīmējums no teksta! Link to comment Share on other sites More sharing options...
janisetnies Posted November 16, 2006 Author Report Share Posted November 16, 2006 (edited) amm, nesaprotu, nekad nesmu strājājis ar javascript! kur man jāliek javascript kods? jataisa javascript dokuments? kādu nosaukumu jāsaglabā? http://www.thecodebehind.com/code/javascri...-textareas.aspx Edited November 16, 2006 by janisetnies Link to comment Share on other sites More sharing options...
andrisp Posted November 16, 2006 Report Share Posted November 16, 2006 Nu tad sāc ar http://www.google.lv/search?hl=lv&q=javascript+basics . Link to comment Share on other sites More sharing options...
janisetnies Posted November 16, 2006 Author Report Share Posted November 16, 2006 http://paste.php.lv/4717 Kas ir nepareizi? Link to comment Share on other sites More sharing options...
bubu Posted November 16, 2006 Report Share Posted November 16, 2006 Kādu kļūdu saka, ja jau nepareizi? Link to comment Share on other sites More sharing options...
janisetnies Posted November 16, 2006 Author Report Share Posted November 16, 2006 (edited) iezīmējot tekstu nospiežot kādu no foršajām pogām nekas nenotiek, tikai pazūd iezīmejums (tumšais kvadrāts, kas pāriet pāri tekstam iezīmejot) un viss! Edited November 16, 2006 by janisetnies Link to comment Share on other sites More sharing options...
janisetnies Posted November 17, 2006 Author Report Share Posted November 17, 2006 Kas varētu būt par kļūdu ka tā nestrādā? Link to comment Share on other sites More sharing options...
janisetnies Posted November 17, 2006 Author Report Share Posted November 17, 2006 Neviens? Link to comment Share on other sites More sharing options...
janisetnies Posted November 17, 2006 Author Report Share Posted November 17, 2006 errors: Error: b is not defined Source File: http://manalapa.lv/mansfails.php Line: 36 36 līnija: // the text before the selection var pretext = textarea.value.substring(0, b.selectionStart); Kas tur ir jāmaina? else { // the text before the selection var pretext = textarea.value.substring(0, b.selectionStart); // the selected text with tags before and after var codetext = open + textarea.value.substring(b.selectionStart, b.selectionEnd) + close; // the text after the selection var posttext = textarea.value.substring(b.selectionEnd, textarea.value.length) // check if there was a selection if(codetext == open + close) { Link to comment Share on other sites More sharing options...
IM24LV Posted November 17, 2006 Report Share Posted November 17, 2006 tu tiešām esi nenormāls? tāda sajūta ka nekad nevienā forumā nebūtu bijis... bljin shitaadam banu un viss... Link to comment Share on other sites More sharing options...
janisetnies Posted November 17, 2006 Author Report Share Posted November 17, 2006 (edited) tu tiešām esi nenormāls? tāda sajūta ka nekad nevienā forumā nebūtu bijis... bljin shitaadam banu un viss... Tiešām ir tik traki? Jā es pasaku es neprotu programmēt un tāpēc prasu palīdzību citiem kas to prot, jo man šobrīd programmēšana nav tas ko es izvēlos mācīties, vienīgi ir lietas ko vajag, un dēļ tam jau neiešu visu programmēšan, actionscript, uut. ābeces lasīt! EDIT: Paldies viss strādā, pats nedaudz pačakarējos! Varat šo spamu dzēst ārā! Edited November 17, 2006 by janisetnies Link to comment Share on other sites More sharing options...
IM24LV Posted November 17, 2006 Report Share Posted November 17, 2006 psc es tev par tavu spamoshanu saku. Link to comment Share on other sites More sharing options...
Recommended Posts