SunnyB Posted August 26, 2009 Report Share Posted August 26, 2009 Hello everybody, I have a field in the datapage that accepts upto 2 characters. i want to limit the input entered to <=25. Any idea how do i do that. I know i have to write some kinda javascript. Here's the datapage: http://b2.caspio.com/dp.asp?AppKey=72721000i7b3a2a7d3j2i5h9h1j9 Field name is Total no. of students taught each day: the user input should not exceed 25. Please help.. Quote Link to comment Share on other sites More sharing options...
MeghaJ Posted August 26, 2009 Report Share Posted August 26, 2009 Hi, If I have understood your question correctly, before submitting the form, you want to check whether the field has value less than 25 or not. You are right that you need a JavaScript for this. a hint: var student = getElementById("InsertRecordfieldname"); var student_num = parsefloat(student.value); if(student_num>25) alert("Student number cant be more than 25"); There is another possible solution for this. If it is possible to have a range instead of exact number, you can have a range dropdown for this. So you can have custom values: Display Value 0-5 5 5-10 10 etc. Regards, Megha Quote Link to comment Share on other sites More sharing options...
SunnyB Posted August 26, 2009 Author Report Share Posted August 26, 2009 Thankyou very much, the javascript worked. You are a lifesaver Quote Link to comment Share on other sites More sharing options...
cheonsa Posted January 3, 2019 Report Share Posted January 3, 2019 Hi @SunnyB, Using the standard feature of Caspio, you can set the minimum and the maximum characters allowed in a field without using JavaScript. You just need to indicate your preferred length. Please refer to the screenshot below. Regards, kristina Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.