Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old December 27th, 2002, 02:48 PM
onesign onesign is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 10 onesign User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
clear input type="text"

There is a frameset:
<frameset rows="0,39,*" frameborder="0">
<frame src="service.php" name="service">
<frame src="message.php" name="message">
<frame src="form.php" name="form">
</frameset>
In frame "form" a small form with check
<SCRIPT LANGUAGE="JavaScript">
function checkFields() {
f=document.forms.form;
if (f.message.value == "")
{
alert("Please fill all the fields.");
return false;
}
</script>

<form action="service.php" target="service" method="post" name="form" onSubmit="return checkFields()">
<input type="text" name="message">
<input type="image" name="submit" src="images/btn_send.gif">
</form>
Acton in file "service.php" and target frame "service"

How can I clear <input type="text" name="message"> after submit.
Frame form does not reloads.

Reply With Quote
  #2  
Old December 27th, 2002, 04:27 PM
dgibson dgibson is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Urbana, MD, USA
Posts: 66 dgibson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
My GOD, why use frames when you have the use of a powerful scripting language such as PHP? ok, you don't have to answer that - maybe there's a reason. That out of the way, first, you should not name things after elements or nodes in the document object model. "form" is close to "forms", so you're ok. But you've also named the form "form" which is going to get confusing even if it doesn't cause any errors.

You could use PHP to look for the form submittal and do an

body onload="form.location='form.php'"

on the service page.

Or on the form page, you could use some JavaScript trickery and onSubmit copy the value to a hidden form field (which you use in the real processing), and clear teh visible form value before sumbmission.

But seriously, if you used PHP to your advantage you would not have to mess with any of this kludgy javascript stuff to do what you want. Unfortunately I use Cold Fusion and can't help you on the specifics tho.

Reply With Quote
  #3  
Old December 27th, 2002, 10:13 PM
onesign onesign is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 10 onesign User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have to use frame, this is for chat.
Thanks for hidden, it helped.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > clear input type="text"


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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 not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway