Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: drop down code PLz help-newbie question


Message #1 by "taherm@f... on Thu, 30 Aug 2001 17:07:35
i have a form with a drop down  with a list of credit cards types in it.

eg. mastercard switch,visa,etc...

there is another field (textbox) called issue number on that same form.

what i want is that when the user selects switch from the drop down menu 

the issue number field on the form should become visible. for any other 

credit card selected the issue number field should be blurred or disappear.

how can i do that.



plz help me..



will appreciate any suggections..

thanks in advance
Message #2 by "Hema R." <hema.r@s...> on Fri, 31 Aug 2001 10:53:37 +0530
Hi,

I have done this for the same requirement mentioned by you.

Try this code it should work...





<HTML>

<HEAD>

<SCRIPT LANGUAGE=javascript>

function checkSwitch()

{

 cardname 

document.frm.cmbCreditCardType.options[document.frm.cmbCreditCardType.select

edIndex].text

 if(cardname.toLowerCase() == "switch")

 {

  document.frm.txtIssueNo.style.display="inline"

 }

 else

  document.frm.txtIssueNo.style.display="none"

} 

</SCRIPT>



<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

</HEAD>

<BODY>

<form name=frm>

<select name="cmbCreditCardType" onchange="checkSwitch()">

 <option value="null">Select CardType</option>

 <option value="1">VISA</option>

 <option value="2">MASTER</option>

 <option value="3">DINERS CLUB</option>

 <option value="4">SOLO</option>

 <option value="5">AMEX</option>

 <option value="6">SWITCH</option>

</select>

<input type=text name=txtIssueNo style="display:none">

<P> </P>

</form>

</BODY>

</HTML>





regards

Hema

> -----Original Message-----

> From: taherm@f... [SMTP:taherm@f...]

> Sent: 30 August Thursday 2001 10:08 AM

> To: ASP Web HowTo

> Subject: [asp_web_howto] drop down  code PLz help-newbie question

> 

> i have a form with a drop down  with a list of credit cards types in it.

> eg. mastercard switch,visa,etc...

> there is another field (textbox) called issue number on that same form.

> what i want is that when the user selects switch from the drop down menu 

> the issue number field on the form should become visible. for any other 

> credit card selected the issue number field should be blurred or

> disappear.

> how can i do that.

> 

> plz help me..

> 

> will appreciate any suggections..

> thanks in advance

>


  Return to Index