Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
i use java script in my asp.net forum which was not supported where is i'm wrong
here is my script....


XML
<td align="left" valign="middle">&nbsp;</td>
  <td width="13%" align="left" valign="middle"><b>Marital Status</b></td>
  <td width="26%" align="left" valign="middle"><select size="3" name="ms1" multiple="true" style="width:180px;height:70px" runat="server">
    <option value="Never Married">Never Married</option>
    <option value="Awaiting Divorced">Awaiting Divorced</option>
    <option value="Divorced">Divorced</option>
    <option value="Widowed">Widowed</option>
    <option value="Anulled">Anulled</option>
    <option value="Married">Married</option>
  </select></td>
  <td width="13%" align="left" valign="middle"><input name="image" type="image"  onclick="javascript:add_seloptions('ms1','ms2','Marital Status');return false;" src="images/btn_add.gif" width="75" height="25" brder="0" />
    <br />
    <br />
    <input name="image" type="image"  onclick="javascript:remove_seloptions('ms2','ms1','Marital Status');return false;" src="images/btn_remove.gif" width="75" height="25" brder="0" /></td>
  <td width="45%" align="left" valign="middle"><select size="3" name="ms2[]" id="ms2" multiple="true" style="width:180px;height:70px;" runat="server">
    <option value="temp">Doesn't Matter</option>
  </select></td>
</tr>
Posted
Updated 6-Aug-12 2:15am
v2
Comments
Where is the javascript code ?
AshishChaudha 6-Aug-12 7:52am    
yes..Where is the javascript code.?? and where are you getting stuck.? what error you are getting??
bbirajdar 6-Aug-12 8:59am    
This is HTML..Not javascript :)
shinebudy 7-Aug-12 1:18am    
sorry by mistake yes this the html code which not working

1 solution

Hi

Your HTML (above) code is perfect.
It worked for me.
I have checked it with my javascript as per your function call and passed argument.
I think there some mistake in javascript .
post the javascript code .
so i will help you.



I am posting my javscript code here

<script type="text/javascript" language="javascript">

function add_seloptions(var1,var2,var3)
{
alert("add");
}
function remove_seloptions(var1,var2,var3)
{
alert("remove");
}

</script

this script worked for me.
so plz POST YOUR SCRIPT CODE.

thanks.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900