/    Sign up×
Community /Pin to ProfileBookmark

dynamic text area limit

Hey I’m building a CMS for my church’s site and on the CMS I have a text area box that uses javascript to limit the amount of characters that can be typed into it. Here’s the [URL=”http://cms.ccgulfbreeze.com/”]CMS[/URL], it’s in the development stage right now. You’ll notice at the top that you can choose which topic you want to update, my question is this…How can I make it so that if the person updating the website chooses Topic Three to update it will change the text area limit to 210 instead of 1000?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@gomisuteAug 11.2007 — looks like you started something...

try an finish it...you're on the right track...I think...


function limitAmount() {

if(document.webForm.id[3].selected){

var limit = "210"

}

else

{

var limit = "1000"

}

}
Copy linkTweet thisAlerts:
@novemberGreyauthorAug 11.2007 — What would I need to finish it?
Copy linkTweet thisAlerts:
@gomisuteAug 12.2007 — What would I need to finish it?[/QUOTE]

you can start by calling the function you wrote (limitAmount) on change...

i.e.
[code=html]<select onChange="limitAmount()">
<option value="">topic...</option>

<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>

</select>[/code]

...

and make your var limit gets used somehow...

try and you shall learn ? ?
×

Success!

Help @novemberGrey spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...