开发者

button to dynamically load $body data into <textarea>

    <form id="form1" name="form1" method="post">
    <textarea name="list" id="emails" rows="10" value="Send to" ondblclick="select_all('emails');" onfocus="if (this.value == 'Send to' || this.value == 'Send to: separate emails by comma and space') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Send to: separate emails by comma and space';}" cols="40">Send to</textarea><br/>
    <input name="subject" id="subject" value="Subject" onfocus="if (this.value == 'Subject') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Your JaGex Account';}" size="17"/>
    <select name="template" id="template" onchange="load();">
        <option value="none">Don't use template</option>
        <option value="RWT">Report Abuse</option>
        <option value="renew">Resend Email Codes</option>
    </select>
    <button name="load" type="submit" id="bt3" onclick="load();" style="width: 50px;"><span>Load</span></button><br/>
    <textarea name="body" rows="10" id="content" ondblclick="select_all('content');" cols="40"><?php echo htmlspecialchars($body)?></textarea><br/>
    <button name="submit" type="submit" id="bt1" onclick="disable();" style="width: 345px;">开发者_如何学C<span>Send</span></button>
    <button name="submit" type="submit" id="bt2" style="visibility:hidden;width: 345px;"><span>Sending...</span>
    </button>
</form>


<script type="text/javascript">
function load() { 
    document.form1.submit(); 
}
</script>

When I click load it doesn't load any option data into the textarea.

else if ($template == "RWT") {
        $body = "Dear Player,<br/><br/>";
        $body .= "We regret to inform you that your account has received an infraction due to a Major offense. Please visit the appeal section under Account Management to view evidence of your infraction(s) and to appeal any infraction(s) that you feel were unjustified.<br/><br/>";

How do I get the data to post inside the textarea?


php

 // have you written this like before else
        $template=$_POST['template'];

    else if ($template == "RWT") {

javascript

 function load()
   {
    document.forms["Your_form"].submit();
   }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜