Jump to content

submit to text box...


rocky3015

Recommended Posts

<input type='submit' name='submitbuttonname' onSubmit='yourtextboxname.value=submitbuttonname.value' />

 

If I'm not mistaken, onsubmit is only a valid event for the form tag itself, not for individual input fields. If you want to capture it on submit, you can take this onsubmit attribute and put it as part of your form tag proper; however, you'll want to change "yourtextboxname.value" to "this.yourtextboxname.value" so the form can locate the field (same with submitbuttonname).

 

Another option would be to handle it in an onclick handler for the submit button instead of the onsubmit. I would do it slightly different than recommended above, but it may just be a preference thing:

<input type="submit" name="submitbuttonname" onclick="this.form.textareaname.value = this.value;" value="My Submit" />

 

Good luck!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.