If i hav an INPUT field, is it possible that the field is only half editable. I mean like this: [blah for you] where the user can only edit "blah" and the rest stays as it is. I know how to add value and disable the field. But is it possible that its only semi-disabled? And the requirement is that, when the form (where the input field is) POSTs the input(s), it only posts the editable "blah" and not the rest of " for you"???? Whoever can help me gets a small reward (will be told via PM )
You'll need to add javascript or PHP. The text field cannot be modified to only edit a portion. It can be disabled and shown or it can be enabled and fully edited. An example of what I'm talking about with javascript or php is The user enters the site and enters their name in an input box. On submitting they're redirected to a different page where it says Name, Welcome to the Site! Is this what you're trying to do?
no i'm not trying to get the user to a different page. Yes maybe javascript is required here, but can u read the thread carefully and tell me wat to do?
I did read it carefully and to my knowledge which I feel is quite vast in HTML, this is not possible. You can also have a user submit a name and it appears on the same page without reload. It's available through javascript, maybe dhtml, and ajax.
wow! would you care to tell us how???? I am developing websites for 6 years from now and i still have no idea how to do this with css alone! you must be a genious!!!
LMFAO I'm adding green for that. I agree with you. He must be a programming god who re wrote the CSS bible.
thank you rebelagent. maybe rohan_shenoy is going to take css coding to new heights. three cheers for rohan!! you're the man!you might land up working for google labs after a google guy sees this thread. @campolar, do you want the disabled text to be sent with the form or to actually show up on the text box itself? if it is only to show up on screen, i suggest you to make two adjacent text boxes and two separate css classes for them so that the borders are on opposite sides and they appear and behave as a single text box. then write your "bla" on one and disable it. hope it helps.
Wish I could rep you again, I didn't think of that. That's pretty dang smart. Well he could just disable the 2nd part and it still can submit though. On the process code for the form he could insert the extra manually. A bit like the finished portion of an email form where it says Thank You, Name. I'd go with that option campolar. Or you could just show us what you're doing so we can get a better picture.
well i didn't understand wat he said... Can you post the html code i should use here? please also see: http://forums.digitalpoint.com/showthread.php?t=931226
ok. by the time rebelagent jots down the codes for this one , please see your other thread. i've replied on it. and i am still waiting for rohan to show up
I don't have time to give you exact code, but here is the basic jist of two ways you could do it. Perhaps this will help get you pointed in the right direction. 1. If you are just doing a "fill in the blank", you could have your input field first and then your static text as just HTML. Like this: <form><input type="text" value="blah" ...> For You. .... {rest of html...} Or 2. Use java script to edit the text as the user types, or right after the user leaves the field. <input type ="text" id="inpUserText" onkeypressed="processKey"> The JavaScript would do something like: .... hmmm... I need to know some things first. Will the input box have the text "for you" in it when they enter the field? When they start typing is it ok to eliminate the "for you" and then have it be put at the end of whatever they type after they leave the field? OR - Do you want the "for you" part to always be in the input box while they are typing?
i want the "for you" part inside the input field and they can only edit behind it, not "for you" itself or type forward to it, only before it.
I tried everything but its not working. I haven't tried wat amazingronit said. Can somebody please explain how to do it?
Hi, Rohit, here it is! I have read your reply, the basic logic is same as you thought of, but while displaying, the borders of the text fields do not align properly and hence you must set all borders for the text fields to none and then wrap the text fields in a span and set inset borders for that span. Pick the complete snippet from http://www.w3hobbyist.com/2008/07/semi-disabled-form-text-fields-with-css/
@rebelagent, Instead of disabling the field, you should set it to readonly when you wish to have it passed to the server, unlike 'disabled'.