how to start word with

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
rajan
Forum Contributor
Posts: 110
Joined: Sun Aug 28, 2005 7:42 pm
Location: Lucknow, UP, India

how to start word with

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.. :roll:
mickd
Forum Contributor
Posts: 397
Joined: Tue Jun 21, 2005 9:05 am
Location: Australia

Post 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 . '';
User avatar
rajan
Forum Contributor
Posts: 110
Joined: Sun Aug 28, 2005 7:42 pm
Location: Lucknow, UP, India

reply for confusion

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post 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.
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post 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          |
         ----------------
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post 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 ;)
Post Reply