我希望能够通过JavaScript将html表单的两个输入字段值连接起来。当我发送一个值并且concat函数接受一个参数时,一切正常。但是当发送两个值并且concat函数接受两个参数时,在concat函数中会打印“<>”,并与user_name连接。我需要从user_name字段中传递标题。
<form "method="post"action="signup.php">
<label>Name:</label>
<input type="text" name="title" id="title" />
<br/>
<label>Email:;
<input type="text" name="user_name" id="user_name" onkeyup="concat(this.value,title.value)" />
</form>