Hip_Hip_Array
02-14-2007, 10:45 AM
1) Script Title: Form field Limiter
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex16/limitinput.htm
3) Describe problem:
Hello all,
I have two text areas on my form and I want this script to check both fields. But I can only get it to check one of them.
This is my form before I add the script:-
<h3>What are your main issues?</h3><br>
<form name="all_issues" action="save_issues.php" method="post">
<textarea rows="6" cols="60" name="main_issues"></textarea><br>
<br><hr><br>
<h3>Please enter any further suggestions</h3><br>
<textarea rows="6" cols="60" name="suggest">
</textarea>
<br></center><br>
<input type="submit" value="Save / Update"></form><hr>
I then put the main part of script in the head and edited the part above like so:-
<h3>What are your main issues?</h3><br>
<form name="all_issues" action="save_issues.php" method="post">
<textarea rows="6" cols="60" id="issues" name="main_issues"> </textarea><br>
<script>
displaylimit("","issues",2000)
</script>
<br><hr><br>
<h3>Please enter any further suggestions</h3><br>
<textarea rows="6" cols="60" id="suggestion" name="suggest"></textarea>
<br>
<script>
displaylimit("","suggestion",2000)
</script>
</center><br>
<input type="submit" value="Save / Update"></form><hr>
The top text area display limit works fine, but the second remains static.
What am I doing wrong? I thought using id's would allow the use of two text areas?
Many Thanks
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex16/limitinput.htm
3) Describe problem:
Hello all,
I have two text areas on my form and I want this script to check both fields. But I can only get it to check one of them.
This is my form before I add the script:-
<h3>What are your main issues?</h3><br>
<form name="all_issues" action="save_issues.php" method="post">
<textarea rows="6" cols="60" name="main_issues"></textarea><br>
<br><hr><br>
<h3>Please enter any further suggestions</h3><br>
<textarea rows="6" cols="60" name="suggest">
</textarea>
<br></center><br>
<input type="submit" value="Save / Update"></form><hr>
I then put the main part of script in the head and edited the part above like so:-
<h3>What are your main issues?</h3><br>
<form name="all_issues" action="save_issues.php" method="post">
<textarea rows="6" cols="60" id="issues" name="main_issues"> </textarea><br>
<script>
displaylimit("","issues",2000)
</script>
<br><hr><br>
<h3>Please enter any further suggestions</h3><br>
<textarea rows="6" cols="60" id="suggestion" name="suggest"></textarea>
<br>
<script>
displaylimit("","suggestion",2000)
</script>
</center><br>
<input type="submit" value="Save / Update"></form><hr>
The top text area display limit works fine, but the second remains static.
What am I doing wrong? I thought using id's would allow the use of two text areas?
Many Thanks