Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 20th, 2006, 11:42 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default the correct way to clear a form field in js

Code:
if (iVia1Out_id!=iControlVar)
        {
            df.via1Out.value = "";
            df.via1Out_id.value = "";
        }
        if (iVia1In_id!=iControlVar)
        {
            df.via1In.value = "";
            df.via1In_id.value = "";
        }
Is this the correct way to clear a form field in javascript?
(or is it = null)?
Picco



www.crmpicco.co.uk
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old March 21st, 2006, 07:35 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi Crmpicco!!
plz find the diff
<SCRIPT>
function onclk()
{
document.myform.mytext.value=null
tst=document.myform.mytext.value
alert(tst.length)
document.myform.mytext.value=""
tst=document.myform.mytext.value
alert(tst.length)
}
</SCRIPT>
<form name="myform">
<input type=text name="mytext">
<input type=button onclick="onclk()">
</form>


Cheers :)

vinod
 
Old March 21st, 2006, 07:41 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Crmpicco!!
for more info ,plz visit the link
http://lists.evolt.org/archive/Week-...14/169524.html


Cheers :)

vinod
 
Old March 21st, 2006, 08:44 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

thanks vinod, that was an interested article you sent. and thanks for the code.......

www.crmpicco.co.uk





Similar Threads
Thread Thread Starter Forum Replies Last Post
JS to check for form Validation does not work - pl jennypretty Classic ASP Basics 4 December 11th, 2008 11:18 PM
How to grey out a form field? kk_sg Access 4 April 29th, 2008 10:11 AM
How do I clear a form after it has been submitted? u2clone ASP.NET 2.0 Basics 7 February 12th, 2008 04:00 PM
How to clear all text box in a form at once time richie86 ASP.NET 1.0 and 1.1 Basics 1 October 31st, 2005 04:57 AM
Requery a Form Field from another Form rocknrisk Access 3 September 16th, 2005 03:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.