tags:

views:

39

answers:

1

i have this textarea, that takes the value of a get function transferred from another page,

<textarea name="inputField" value="<?php echo $_GET['replyto'];?>" id="inputField" tabindex="1" rows="2" cols="40"onblur="DoBlur(this);" onfocus="DoFocus(this);" ></textarea>

this is the url link,

http://localhost/final/home.php?replyto=@sam&amp;status_id=2&amp;reply_name=sam

its not inserting @sam in the textbox, is thier something wrong?

+3  A: 

The contents of a <textarea> don't go into the "value" parameter, they go between <textarea> and </textarea>. Try this:

<textarea name="inputField" id="inputField" tabindex="1" rows="2" cols="40"onblur="DoBlur(this);" onfocus="DoFocus(this);" >
<?php echo $_GET['replyto'];?>
</textarea>
steven_desu
thanks that works, but it deosnt focus on the textarea, do you know how i can achieve this! by the way im accepting your answer ;)) cheers again +1 vote
getaway
If you want to set focus when the page loads, you needs to just use the Javascript `focus()` function. So for instance, if your `<textarea>` was a member of `<form name="theForm">`, you would want to add the following to your `<body>` tag: `<body onload="document.theForm.inputArea.focus();">`
steven_desu