![]() Note that the user can still type 15 characters if he types quickly. Any time the used exceeds the character limit, the input is reset by the observer to the maximum character limit, and a modal dialog pops up, informing the user of the mistake. Here is a possible solution which uses an observeEvent like you did in your solution. Please note that you should put the line library(shinyjs) and useShinyjs() in your ui for this to work. add shinyjs::runjs("$('#mytext').attr('maxlength',8)") to your server. R-release (arm64): shinyjs_2.1.0.tgz, r-oldrel (arm64): shinyjs_2.1.0.tgz, r-release (x86_64): shinyjs_2.1.0.tgz, r-oldrel (x86_64): shinyjs_2.1.0.tgzĬrisprseekplus, monobinShiny, RSCAT, sangeranalyseR, stmguiĪctivAnalyzer, ADAMgui, addinslist, adepro, AdhereRViz, AFM, airGRteaching, AMPLE, animalcules, animaltracker, apisensr, appreci8R, arena2r, auth0, bdchecks, bdclean, bdDwC, bestSDP, BiasCorrector, BlockmodelingGUI, bulkAnalyseR, CaPO4Sim, Certara.R, ChromSCape, cjoint, cmsaf, CNVPanelizer, cognitoR, colourpicker, ComPrAn, corporaexplorer, CRANsearcher, crossmeta, CruzPlot, CyTOFpower, DataEditR, ddpcr, deBif, debrowser, dextergui, DiscoRhythm, discoveR, DistPlotter, dosedesignR, dPCP, DQAgui, dragulaR, dtwclust, Eagle, elementR, EventDetectGUI, ExploreModelMatrix, fdapaceShiny, FielDHub, filterNHP, forecasteR, GA4GHshiny, geneHapR, GenEst, genogeographer, GeoWeightedModel, GFD, GFDsurv, ggExtra, ggquickeda, gimmeTools, GMSE, gridstackeR, gwpcormapper, GWSDAT, INSPECTumours, IntLIM, iSEE, iSEEhub, isobxr, IsoCor, LACE, LCMSQA, LDABiplots, LDAShiny, leafdown, levi, LFApp, lightsout, lmviz, loadeR, makemyprior, manipulateWidget, MatrixQCvis, MDMAPR, meltt, memapp, methylscaper, microbiomeExplorer, MiMIR, miniMeta, mlr3shiny, mmaqshiny, mrMLM.GUI, MSstatsShiny, mstrio, musicatk, netShiny, NiLeDAM, npregfast, oceanexplorer, oceanis, omicsViewer, openPrimeRui, OpenRepGrid.ic, packagefinder, PathoStat, PERK, pguIMP, PhyloProfile, piano, PoDCall, polished, predictoR, PRISMA2020, ProjectionBasedClustering, pRolocGUI, Prostar, psichomics, quarks, RadialVisGadgets, RALSA, ReDaMoR, regexSelect, regressoR, ReviewR, RSP, safetyGraphics, sdcHierarchies, shiny.I created a solution without javascript below, but it is actually much simpler as always, the shinyjs package can simplify things greatly: How to limit the number of characters accepted by textInput in Shiny app. ![]() Shinyjs example app walk-through extendShinyjs - Calling your own JavaScript functions from R Including shinyjs in different types of apps Package shinyjs Htmltools (≥ 0.2.9), knitr (≥ 1.7), rmarkdown, shinyAce, shinydisconnect, testthat (≥ 0.9.1) 'shinyjs' can alsoīe used to easily call your own custom JavaScript functions from R. Useful functions for both the end user and the developer. Its original value, delaying code execution by a few seconds, and many more Include: hiding an element, disabling an input, resetting an input back to Greatly improve your apps without having to know any JavaScript. Perform common useful JavaScript operations in Shiny apps that will ![]() Shinyjs: Easily Improve the User Experience of Your Shiny Apps in Seconds
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |