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
https://forums.phpfreaks.com/topic/123720-submit-to-text-box/#findComment-639813
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.