Page 1 of 1
how to start word with
Posted: Tue Oct 04, 2005 4:46 pm
by rajan
how we can set the text start with string is which is not editable after it we can concat a number.
example: is1
is2
is3
in the example is in textfield is not editable and 1,2 3 will fill by user
Posted: Tue Oct 04, 2005 6:19 pm
by feyd
you don't place the text in the text field... of course I could misunderstand your post since it's quite difficult to understand all your posts..

Posted: Tue Oct 04, 2005 6:37 pm
by mickd
the only way i can think of a way (provided i understand what you mean) is
Code: Select all
$var_to_insert = 'is' . $user_specified_number . '';
reply for confusion
Posted: Tue Oct 04, 2005 6:57 pm
by rajan
as micked answered, i am not talking about php code. in php i know it's very simple but i want to know :
Now I am explaining more:
suppose ther is textfield in the form . in which there is some text.
i want to make text readonly but after that text in same textfield i want to insert some text.
user does not have permission to change that readonly text. after that he can concate text.
Example: hello raj
the above text is written in text field where hello can not be editable and raj is editable.
how can we do this using client side scripting?
Posted: Tue Oct 04, 2005 7:20 pm
by feyd
it's not especially possible. That's why I said don't store it in the text field. The only possible way is processing every key press when inside that text field using the onkeypress event... rather painful to give the functionality, wouldn't you say?
Posted: Tue Oct 04, 2005 8:10 pm
by josh
You could just check the following on key press:
document.forms[1].value == ''
if that returns true then set the other text box to readonly via javascript, the in the else statement youd enable the textbox that was readonly before.
Posted: Wed Oct 05, 2005 4:19 am
by pilau
Doing what you said will require 2 text fields, jspro2.
Rajan stated he wants to do it one.
Rajan, you can't set the readonly option only to part of the text in a textfield.
What I suggest on doing, is just printing the text to the left of the tex fiel, like this
Code: Select all
----------------
hello | raj |
----------------
Posted: Wed Oct 05, 2005 4:34 am
by n00b Saibot
Only way I see it possible is what feyd told you. Process onclick event and don't let the user edit before the specified string and thatsit
