icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.
Old March 24th, 2006, 7:42 PM   #1 (permalink)
Bow before Surpass!
Super #1
 
Joined in Sep 2004
1,542 posts
Gave thanks: 91
Thanked 49 times
How to go about...

Well, I've come to yet another thing that I wish to do that was well is limited to me at the moment. I'm wondering if there is an javascript for this... anyways...

I have a form abd a iframe. Now this form submits text data into this iframe. However, once complete the text is still in the input field. Is there some sort of java to clear the text input field on submission?

Another thing. I have a refresh button that is in the same form. What would be the "onclick" command to have it refresh what is in the iframe?

Thanks guys, once my site is bug free, I'll link to it... somehwere... that is allowed :P
__________________
GamingHybrid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 24th, 2006, 9:07 PM   #2 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Hosted on Gojira
8,027 posts
Gave thanks: 48
Thanked 129 times
You should be able to do something like this in JavaScript to clear a form element.

Code:
document.getElementById('formElementID').value = '';
There's probably easier ways to do it to all form elements.. but I'd have to look it up.

If you want a button that clears or resets a form, you could just use :
Code:
<input type="reset" name="reset" value="reset" />
This resets a form to it's initial state on the page load.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 24th, 2006, 9:08 PM   #3 (permalink)
Surpass Fan
Excelling Contributor
 
cowboy's Avatar
 
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
934 posts
Gave thanks: 2
Thanked 94 times
Make the last line of the script doing the submitting, redirect to itself with a location statement. That will clear the fields and, also, the post variables, should a refresh be attempted. If you want your refresh button to clear all the fields, make your onclick= the same location statement used above.
__________________
Where would you be if you were at the highest court in the land (US)?
cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 25th, 2006, 3:52 AM   #4 (permalink)
Bow before Surpass!
Super #1
 
Joined in Sep 2004
1,542 posts
Gave thanks: 91
Thanked 49 times
Nah, the 2nd thing with the button was the refresh the iframe, not form. Anyways, thank you, it's been cleared now About to post another, yet simple, question.,..
__________________
GamingHybrid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On