HighDots Forums  

Re: Javascript Newbie

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Re: Javascript Newbie in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
splendorx webforumsuser@macromedia.com
 
Posts: n/a

Default Re: Javascript Newbie - 07-16-2003 , 01:34 PM






I would like to add different values to form fields if the information has not been entered. With the above script it applies a value of nbsp; to both form fields, but I would like to assign a seperate value for each form field. ie.

ShipDate = 07/16/2003
TrackingNo = &nbsp

How would I add this functionality to javascript above?

TIA

Terry



Reply With Quote
  #2  
Old   
splendorx webforumsuser@macromedia.com
 
Posts: n/a

Default Re: Javascript Newbie - 07-16-2003 , 02:09 PM






I have revised the script and it works. Not sure if the code can be optimized??? If so, please let me know.

Thanks,

Terry
<script language="JavaScript" type="text/JavaScript">
<!--
function IsEmpty(form) {
for(f=0;f<form.length;f++){
if( !form[f].value && (form[f].name=="TrackingNo")){
form[f].value="&nbsp;";
}
if( !form[f].value && (form[f].name=="ShipDate")){
form[f].value="01/01/2003";
}
}
}
//-->
</script>



Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.