Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > JavaScript > JS Function to ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 35576 of 37128
Post > Topic >>

JS Function to Insert Values Across Child Frames - Need Help

by RoRNoob <rornoob@[EMAIL PROTECTED] > May 12, 2008 at 01:04 PM

I'd like the bar.html file to take the values contained in hidden
fields and stuff them into the form fields found on mymessagebox.html.
I can get it working no problem if it is all on the same page, but I'm
having trouble getting it to work across pages via the index.html
frames. Any help is appreciated.

code:

----- application.js -----

function inject_message() {
    $('messagesubject').value = $F('hidden_subject');
    $('messagebody').value = $F('hidden_body');
}

function clear_message() {
    $('messagesubject').value = "";
    $('messagebody').value = "";
}

----- index.html -----

<frameset rows="5%, 95%">
<frame src="bar/bar" name="bar">
<frame src="bar/mymessagebox" name="mymessagebox">
</frameset>

----- bar.html -----

<%= javascript_include_tag :defaults %> <!-- this loads application.js
-->

<a href='javascript:inject_message()'>inject me</a> | <a
href='javascript:clear_message()'>clear me</a>

<input type="hidden" id="hidden_subject" name="hidden_subject"
value="Hi there"/>
<input type="hidden" id="hidden_body" name="hidden_body" value="My
cool message"/>

----- mymessagebox.html -----

<div>

	<div>
		<p>Subject:</p>
		<div>
			<div>
				<input type="text" style="width: 450px;" tabindex="1"
id="messagesubject" name="messagesubject"/>
			</div>
		</div>
	</div>

	<div>
		<p>Body:</p>
		<div>
			<textarea style="width: 450px;" tabindex="2" id="messagebody"
cols="20" rows="20" name="messagebody"/>
			</textarea>
		</div>
	</div>

</div>
 




 4 Posts in Topic:
JS Function to Insert Values Across Child Frames - Need Help
RoRNoob <rornoob@[EMAI  2008-05-12 13:04:28 
Re: JS Function to Insert Values Across Child Frames - Need Help
venti <timgregory@[EMA  2008-05-12 14:28:21 
Re: JS Function to Insert Values Across Child Frames - Need Help
SAM <stephanemoriaux.N  2008-05-13 03:56:08 
Re: JS Function to Insert Values Across Child Frames - Need Help
SAM <stephanemoriaux.N  2008-05-13 03:51:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 14:57:04 CDT 2008.