if radio(Is Pay to Address different from above?) is true, Fields r appeared.

Posted by maninaanee-8287 under ASP.NET on 12/13/2011 | Points: 10 | Views : 816 | Status : [Member] | Replies : 5
In Radio button(Is Pay to Address different from above?) is true, then Address to , Address From,Pat to city,pay-to-state and pay-to-Zip fields are appeared.
When press Radio button false, that fields are disappeared.
once check my zip file.




Responses

Posted by: Arefin on: 12/13/2011 [Member] Starter | Points: 25

Up
0
Down
hey,

what is your demand? Plz clarify...

Thanks,
Arefin

maninaanee-8287, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: maninaanee-8287 on: 12/13/2011 [Member] Starter | Points: 25

Up
0
Down
Hi, This is my code. Is it o.k na? when u clicked on radiobutton Yes, Then Address Field1,Address Field2..........Upto Pay-To-Zip fields are Appeared(Enabled)
If radiobutton is false,Then fields are dis appear(disabled). Please guide me.
<title>Untitled Page</title>
<script language="javascript">

function MyFunction()
{
var rdb = document.getElementByID('<%=PAYABLEFlgY.ClientID %>');
if (!rdb.Checked)
{
document.getElementById('<%=Text1.ClientID%>').Style.display = "None";
}
else
{
document.getElementById('<%=Text1.ClientID%>').Style.display = "block";
}
return true;

}

</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td class=""table_bgclr_left_green">
Is Pay to Address different from above?</td>
<td class="table_bgclr_right_green" colspan="3">
<input type="radio" name="PAYABLE" id="PAYABLEFlgY" value="Y" runat="server" tabindex="47" />Yes &nbsp;&nbsp;
<input type ="radio" name="PAYABLE" id="PAYABLEFlgN" value="N" runat="server" tabindex="47" />NO
<br />
</td>
<tr id="Tr2">
<td class="table_bgclr_left_green" width="10%">
Address Line1
</td>
<td class="table_bgclr_right_green">
<input maxlength="100" name="txtAddressLine1" id="Text1" onchange='this.value=this.value.toUpperCase()' onblur="this.value=this.value.toUpperCase();" size="25" runat="server" tabindex="49" onclick= "return MyFunction()" />
</td>
<td class="table_bgclr_left_green" align="left" id="Td1">
Address Line2
</td>
<td class="table_bgclr_right_green" id="Td2">
<input maxlength="60" name="txtAddress Line2" id="TEXT2" type="TEXT" onblur=""
value="" runat="server" tabindex="50">
</td>
</tr>
<tr>
<td class="table_bgclr_left_green">
Pay-To City
</td>
<td class="table_bgclr_right_green" width="25%">
<input maxlength="9" name="txtPayToCity" id="Text3" onchange='this.value=this.value.toUpperCase()'
onblur="this.value=this.value.toUpperCase();" value="" runat="server" tabindex="51">
</td>
<td class="table_bgclr_left_green" width="10%">
Pay-To-State
</td>
<td class="table_bgclr_right_green">
<input maxlength="9" name="txtPayToState" id="Text4" onchange='this.value=this.value.toUpperCase()'
onblur="this.value=this.value.toUpperCase();" value="" runat="server" tabindex="52">
</td>


</tr>
</tr>
<tr id="Tr2">
<td class="table_bgclr_left_green" width="10%">
Pay-To-Zip
</td>
<td class="table_bgclr_right_green" nowrap="nowrap">
<input maxlength="3" name="txtPayToZip1" id="Text5" onchange='this.value=this.value.toUpperCase()'
onblur="this.value=this.value.toUpperCase();" value="" runat="server" tabindex="52" onclick="return Text5_onclick()"> +4 &nbsp;<input maxlength="3" name="txtPayToZip2" id="Text6" onchange='this.value=this.value.toUpperCase()'
onblur="this.value=this.value.toUpperCase();" value="" runat="server" tabindex="52"></td>

</tr>
</table>

</div>

maninaanee-8287, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 12/14/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Maninaanee@gmail.com please use the code formatting provided. no one wll read your code looking like this

Thank you for posting at Dotnetfunda
[Administrator]

maninaanee-8287, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 12/14/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi padma, there is little bit change in code.....plz paste code


<title>Untitled Page</title>
<script language="javascript">

function MyFunction()
{
var rdb = document.getElementByID('<%=PAYABLEFlgY.ClientID %>');
if (!rdb.Checked)
{
document.getElementById('<%=Text1.ClientID%>').Style.display = "None";
}
else
{
document.getElementById('<%=Text1.ClientID%>').Style.display = "block";
}
return true;

}

</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td class=""table_bgclr_left_green">
Is Pay to Address different from above?</td>
<td class="table_bgclr_right_green" colspan="3">
<input type="radio" name="PAYABLE" id="PAYABLEFlgY" value="Y" runat="server" tabindex="47" onclick="return Myfunction();" />Yes &nbsp;&nbsp;
<input type ="radio" name="PAYABLE" id="PAYABLEFlgN" value="N" runat="server" tabindex="47" onclick="return Myfunction();" />NO
<br />
</td>
<tr id="Tr2">
<td class="table_bgclr_left_green" width="10%">
Address Line1
</td>
<td class="table_bgclr_right_green">
<input maxlength="100" name="txtAddressLine1" id="Text1" onchange='this.value=this.value.toUpperCase()' onblur="this.value=this.value.toUpperCase();" size="25" runat="server" tabindex="49" onclick= "return MyFunction()" />
</td>
<td class="table_bgclr_left_green" align="left" id="Td1">
Address Line2
</td>
<td class="table_bgclr_right_green" id="Td2">
<input maxlength="60" name="txtAddress Line2" id="TEXT2" type="TEXT" onblur=""
value="" runat="server" tabindex="50">
</td>
</tr>
<tr>
<td class="table_bgclr_left_green">
Pay-To City
</td>
<td class="table_bgclr_right_green" width="25%">
<input maxlength="9" name="txtPayToCity" id="Text3" onchange='this.value=this.value.toUpperCase()'
onblur="this.value=this.value.toUpperCase();" value="" runat="server" tabindex="51">
</td>
<td class="table_bgclr_left_green" width="10%">
Pay-To-State
</td>
<td class="table_bgclr_right_green">
<input maxlength="9" name="txtPayToState" id="Text4" onchange='this.value=this.value.toUpperCase()'
onblur="this.value=this.value.toUpperCase();" value="" runat="server" tabindex="52">
</td>


</tr>
</tr>
<tr id="Tr2">
<td class="table_bgclr_left_green" width="10%">
Pay-To-Zip
</td>
<td class="table_bgclr_right_green" nowrap="nowrap">
<input maxlength="3" name="txtPayToZip1" id="Text5" onchange='this.value=this.value.toUpperCase()'
onblur="this.value=this.value.toUpperCase();" value="" runat="server" tabindex="52" onclick="return Text5_onclick()"> +4 &nbsp;<input maxlength="3" name="txtPayToZip2" id="Text6" onchange='this.value=this.value.toUpperCase()'
onblur="this.value=this.value.toUpperCase();" value="" runat="server" tabindex="52"></td>

</tr>
</table>

</div>


Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

maninaanee-8287, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: maninaanee-8287 on: 12/14/2011 [Member] Starter | Points: 25

Up
0
Down
Hi Himanshu,
I got an error in Onclick event(Microsoft JScript runtime error: 'Myfunction' is undefined). Once check it.

maninaanee-8287, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response