|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
I have to use frame, this is for chat.
Thanks for hidden, it helped. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > clear input type="text" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|