View Full Version : Form field Limiter
avidcat
08-03-2008, 04:04 AM
1) Script Title: Form field Limiter
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex16/limitinput.htm
3) Describe problem: I am trying to use this script for 3 different text boxes within the same form. But after I add a second text box with the script they both stop working.
I am naming each text box separtely and changing the names within the displaylimit code area but still it doesn't want to work.
Am I missing something?
Thanks,
mburt
08-03-2008, 04:08 AM
Did you put the:
<script type="text/javascript">
displaylimit("","johndoe",10)
</script>
Under the third input?
avidcat
08-03-2008, 04:26 AM
Here is the code I have for all three text boxes.
<form id="form1" method="post" action="">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="20" valign="top"><div align="left" class="style3"><strong>Tell us about your business.</strong></div></td>
</tr>
<tr>
<td height="147" valign="top"><div align="left" class="style3">
<textarea name="Question1" id="Question1" cols=50 rows=7></textarea>
<br>
<script>displaylimit("","Question1",180)</script>
</div></td>
</tr>
<tr>
<td height="22" valign="top"><div align="left" class="style3"><strong>How did you get started selling online?</strong></div></td>
</tr>
<tr>
<td height="146" valign="top"><div align="left" class="style3">
<textarea name="Question2" id="Question2" cols=50 rows=7></textarea>
<br>
<script>displaylimit("","Question2",150)</script>
</div></td>
</tr>
<tr>
<td height="24" valign="top"><div align="left" class="style3"><strong>What challenges do you face selling online?</strong></div></td>
</tr>
<tr>
<td height="148" valign="top"><div align="left" class="style3">
<textarea name="Question3" id="Question3" cols=50 rows=7></textarea>
<br>
<script>displaylimit("","Question3",120)</script>
</div></td>
</tr>
<tr>
<td valign="top"><div align="left" class="style3">
<input type="submit" name="button" id="button" value="Submit Interview" />
</div></td>
</tr>
</table>
</form>
avidcat
08-03-2008, 05:24 AM
I searched and found a post on here that helped me fix it.
I really just started from scatch and it seems to be working now.
Here is my new code:
<form name="interview" action="save_issues.php" method="post">
<p><strong>Tell us about your business.</strong> </p>
<p>
<textarea rows="6" cols="60" id="question1" name="acquestion1"> </textarea>
<br>
<script>
displaylimit("document.interview.acquestion1","",2000)
</script>
<br>
</p>
<hr />
<p><strong>How did you get started selling online?</strong></p>
<p>
<textarea rows="6" cols="60" id="question2" name="acquestion2"></textarea>
<br />
<script>
displaylimit("document.interview.acquestion2","",2000)
</script>
</p>
<hr />
<p><strong>What challenges do you face selling online?</strong></p>
<p>
<textarea rows="6" cols="60" id="question3" name="acquestion3"></textarea>
<br>
<script>
displaylimit("document.interview.acquestion3","",2000)
</script>
</center>
<br>
<input type="submit" value="Submit Interview">
</p>
</form>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.