|
ASP in Javascript
Hi there...I am trying to create a input form field with a value say " American Express". When user clicks on this field to edit it, it turns into a dropdown menu which is pulling all credit cards names from a database table....so users can choose an option from the menu....
1) Is is too much hassle to achieve...I thought it might be kinda neat.
2) Here's the code:
<form name="CreditCardform" method="post" action="anaspppage.asp", target="main">
<td><input name=CardType onclick="ShowDropDown();" Value="<%=CreditCardDetail("Description")%>"></td>
</form>
========================================================
<script language="JavaScript1.2"><!--
function ShowDropDown()
{
<% mySQL = "SELECT * FROM CreditCardTypes order by code"
Set CreditCardTypes= Con.Execute( mySQL )
%>
<td class=tabletd><select name=CardType class=fields>
<option></option>
<% do while CreditCardTypes.eof<>true %>
<option <% if request("CardType")=CreditCardTypes("Description") then %>selected<% end if %> value='<%=CreditCardTypes("Code")%>'><%=CreditCardTypes("Description")%></option>
<% CreditCardTypes.movenext
loop
CreditCardTypes.close
set CreditCardTypes=Nothing%>
<% end if %>
</td>
}
// --></script>
=======================================================
The javascript is completely wrong coz I just copied it from the existing form but thats the idea of what a want to try...a drop down..maybe i should use document.Page.homephone.value=document.CreditCardform.CardType.value= something.....any clues????
|