This topic is locked

Dropdown on Change

9/10/2008 1:22:18 PM
ASPRunnerPro General questions
D
dgisdet author

I have a dropdown called Status. When a user selects status of completed I would like another field to automatically populate the field date completed with the current dateTime (Now()

J
Jane 9/11/2008
D
dgisdet author 9/11/2008

Hi,

please check following thread:

http://www.asprunner.com/forums/index.php?showtopic=6503


I tried the thread you suggsted I still could not get it to work. Can you giuve me more specifics excatly wher eit should go. Thanks

J
Jane 9/12/2008

Mike,
please post your code here and I'll try to help you.

D
dgisdet author 9/16/2008

Mike,

please post your code here and I'll try to help you.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>Outstanding</TITLE>

<META http-equiv=Content-Type content="text/html; charset=windows-1252"><LINK

href="include/style.css" type=text/css rel=stylesheet>{$includes}

<META content="MSHTML 6.00.6000.16386" name=GENERATOR></HEAD>

<BODY {$bodyonload}>

<FORM name=editform action=Outstanding_edit.asp method=post

encType=multipart/form-data {$onsubmit}>{include_if_exists file="include/header.asp"} {doevent name="EditOnLoad"}

<TABLE cellSpacing=0 cellPadding=0 align=center border=0>

<TBODY>

<TR>

<TD colSpan=2>

<TR>

<TD><B class=xtop><B class=xb1b></B><B class=xb2b></B><B class=xb3b></B><B

class=xb4b></B></B>

<DIV class=xboxcontentb>

<TABLE class=main_table cellSpacing=0 cellPadding=0 border=0>

<TBODY>

<TR>

<TD>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>

<TBODY>

<TR>

<TD class=upeditmenu vAlign=middle align=middle width="100%" height=35>Outstanding, Edit record [ ProjID: {$show_key1}]

<input type=hidden name=editid1 value="{$key1}"></TD></TR></TBODY></TABLE></TD></TR>

<TR>

<TD width="100%" bgColor=white height=1></TD></TR>{if $message!=""}

<TR>

<TD

style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px"

align=middle width="100%">

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>

<TBODY>

<TR>

<TD><B class=xtop><B class=xb1u></B><B class=xb2u></B><B

class=xb3u></B><B class=xb4u></B></B>

<DIV class=xboxcontentb>

<TABLE cellSpacing=0 cellPadding=5 width="100%" align=center

border=0>

<TBODY>

<TR>

<TD class=downedit2

align=middle>{$message}</TD></TR></TBODY></TABLE></DIV><B

class=xbottom><B class=xb4u></B><B class=xb3u></B><B

class=xb2u></B><B

class=xb1u></B></B></TD></TR></TBODY></TABLE></TD></TR>{/if}

<TR>

<TD

style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px">

<DIV class=xboxcontent>

<TABLE cellSpacing=0 cellPadding=4 border=0>

<TBODY>

<TR>

<TD class=editshadeleft_b2 style="PADDING-LEFT: 15px"

width=150>Location</TD>

<TD class=editshaderight_lb2 style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="Location" value=$value_Location mode="edit"} &nbsp;<IMG

src="images/icon_required.gif"> </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>ProjectTitle</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="ProjectTitle" value=$value_ProjectTitle mode="edit"}

&nbsp;<IMG src="images/icon_required.gif"> </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>Status</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="Status" value=$value_Status mode="edit"} &nbsp;<IMG

src="images/icon_required.gif"> </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>Notes</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="Notes" value=$value_Notes mode="edit"} </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>AssignedTo</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="AssignedTo" value=$value_AssignedTo mode="edit"} </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>ProjStart</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="ProjStart" value=$value_ProjStart mode="edit"} </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>ProjEnd</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="ProjEnd" value=$value_ProjEnd mode="edit"} </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>Priority</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="Priority" value=$value_Priority mode="edit"} &nbsp;<IMG

src="images/icon_required.gif"> </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>DateCreated</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="DateCreated" value=$value_DateCreated mode="edit"} </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>PercentComplete</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="PercentComplete" value=$value_PercentComplete mode="edit"}

</TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>LastEditDate</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="LastEditDate" value=$value_LastEditDate mode="edit"} </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>LastEditBy</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="LastEditBy" value=$value_LastEditBy mode="edit"} </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>DateCompleted</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="DateCompleted" value=$value_DateCompleted mode="edit"} </TD></TR>

<TR>

<TD class=editshade_b style="PADDING-LEFT: 15px"

width=150>AssigneeEmail</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px"

width=250>{build_edit_control field="AssigneeEmail" value=$value_AssigneeEmail mode="edit"} </TD></TR>

<TR>

<TD class=downedit align=left colSpan=2><IMG

src="images/icon_required.gif"> - Required field </TD></TR>

<TR>

<TD class=downedit align=middle colSpan=2><SPAN

class=buttonborder><INPUT class=button type=submit value=&nbsp;&nbsp;Save&nbsp;&nbsp; name=submit1></SPAN>

<SPAN class=buttonborder><INPUT class=button type=reset value=&nbsp;&nbsp;Reset&nbsp;&nbsp;></SPAN>

<SPAN class=buttonborder><INPUT class=button onclick="window.location.href='Outstanding_list.asp?a=return'" type=button value="&nbsp;&nbsp;Back to list&nbsp;&nbsp;"></SPAN>

<input type=hidden name="a" value="edited"></TD></TR></FORM></TBODY></TABLE></DIV><B

class=xbottom><B class=xb4a></B><B class=xb3a></B><B

class=xb2a></B><B class=xb1a></B></B></TD></TR></TBODY></TABLE></DIV><B

class=xbottom><B class=xb4b3></B><B class=xb3b3></B><B class=xb2b3></B><B

class=xb1b3></B></B></TD></TR></TBODY></TABLE><BR>{include_if_exists file="include/footer.asp"} {$linkdata}<script>SetToFirstControl();</script>
<script>

document.forms.editform.value_Status.onchange=function()

{

if(this.options[this.selectedIndex].value=='Completed')

document.forms.editform.value_DateCompleted.Value=Now();

else

{

document.forms.editform.value_DateCompleted.Value="";

}

</script>
</BODY></HTML>

J
Jane 9/16/2008

Hi,
see my changes in Bold:

{literal}<script>

document.forms.editform.value_Status.onchange=function()

{

if(this.options[this.selectedIndex].value=='Completed')

document.forms.editform.value_DateCompleted.Value=Date();

else

document.forms.editform.value_DateCompleted.Value="";

}

</script>{/literal}

D
dgisdet author 9/16/2008

Hi,

see my changes in Bold:


When I add this to the end of the htm in Templates folder I get a website cannot display this page

D
dgisdet author 9/16/2008



When I add this to the end of the htm in Templates folder I get a website cannot display this page


It does not crash now. But it does not change the DateCompleted Value

J
Jane 9/17/2008

Mike,
It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.

D
dgisdet author 9/17/2008

Mike,

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.


http://demo.asprunner.net/ReddingMmacomb...ect19/login.asp

login admin admin