By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,600 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,600 IT Pros & Developers. It's quick & easy.

Restricting user input

P: 1
Strange question coming ...

I need to be able to provide the user the ability to insert appropriate text (not free-form) at a point in a file.

I was thinking of loading the file into a text area input. There would be an additional set of buttons for each of the pieces of text to be inserted. The user could navigate using their cursor within the text area to the point within the text area where text insertion is to occur. They would then press the appropriate button for that text to be inserted at the cursor.

This raises some challenges! The text could easily be loaded and the entire field disabled, but how would the (presumably) Javascript then be able to insert text at the cursor point? Any help will be much appreciated.
Aug 31 '06 #1
Share this Question
Share on Google+
2 Replies


acoder
Expert Mod 15k+
P: 16,027
This thread should help.
May 12 '08 #2

dlite922
Expert 100+
P: 1,584
Strange question coming ...

I need to be able to provide the user the ability to insert appropriate text (not free-form) at a point in a file.

I was thinking of loading the file into a text area input. There would be an additional set of buttons for each of the pieces of text to be inserted. The user could navigate using their cursor within the text area to the point within the text area where text insertion is to occur. They would then press the appropriate button for that text to be inserted at the cursor.

This raises some challenges! The text could easily be loaded and the entire field disabled, but how would the (presumably) Javascript then be able to insert text at the cursor point? Any help will be much appreciated.
There's a couple of ways to tackle this problem, assuming the position in the file is predefined

You can just display the content as a text and display it. At the appropriate spot, insert a text area or text box for the user to make their additions. In your case its not free-form, so it could be a drop down box.

You can then string it together server-side.

Or try disabling the text area and insert the appropriate text there with javascript, it should let you even if disabled.

Good luck,

Dan
May 13 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.