Computing.Net > Forums > Web Development > clear form through seperate frame

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

clear form through seperate frame

Reply to Message Icon

Name: jake1025
Date: February 8, 2005 at 19:53:21 Pacific
OS: win xp home
CPU/Ram: 800/256
Comment:

I dont know the best way to word this but i've ran into a situation where i need to be able to clear the contents of a text box (in the main frame) through an inline frame embedded inside the document.

Im sure i could call a javascript function from the child frame like:

document.formID.textboxID.clear();

but how would i direct this to the parent frame?

does anyone understand waht im asking?

Thanks for any help,
Jake



Sponsored Link
Ads by Google

Response Number 1
Name: Dr. Nick
Date: February 8, 2005 at 21:11:09 Pacific
Reply:

You're on the right track. Use this code from within the IFRAME:

parent.document.getElementById('box').value='';

Where 'box' is the ID attribute of your textbox you want to clear. You should no longer use the global access method to acquire HTML elements. IE, use

document.getElementById('id').value = '';

instead of

document.form.id.value = '';

(note that those are double single quotes ['], not double quotes ["])


0

Response Number 2
Name: jake1025
Date: February 9, 2005 at 03:36:48 Pacific
Reply:

Hey that worked! Thanks nick!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: clear form through seperate frame

Email Form posting www.computing.net/answers/webdevel/email-form-posting/1081.html

HTML form problem www.computing.net/answers/webdevel/html-form-problem/1736.html

php vs javascriopt www.computing.net/answers/webdevel/php-vs-javascriopt/537.html