Hi there, new here, so bare with me!
I’ve got a web page where I’d like to set the value of a hidden field after the page has loaded (to the value of user input in an iframe) but when the “save” button is clicked. I’m trying to do it so that when the save button is clicked and the form processed it calls update_hidden_field() which sets the value of the hidden field (called “iframeText”) to the content of the iframe(called “view”).
Here are the critical bits of code:-
[CODE]
<script>
function update_hidden_field() {
iframeText.value = view.document.body.innerHTML;
return true;
}
</script>
….
<form name=”page_editor” METHOD=”POST” action=”/cgi-bin/page_editor/Process_page_editor_form.pl” onsubmit=”return update_hidden_field(this.form)”>
<iframe id=”view” src=”body.html”></iframe>
<input name=”iframeText” type=”hidden” value=””></input>
<input type=”submit” name=”operation” value=”Save”>
Many thanks in advance for your time and help ?
Scruff