RnD
03-21-2003, 06:07 PM
Consider the following code:
<html>
<head>
<title>Eg1.htm</title>
<script language="JavaScript">
function displayParameter(param1)
{
alert("Parameter: " + param1);
}
</script>
</head>
<body>
<form name=form1>
<table border=1 align=center>
<th>Enter A Parameter</th>
<tr><td><input type=text name=text1></td></tr>
<tr>
<td align=center>
<input type=button value=Go onClick=displayParameter(document.form1.text1.value)>
<input type=button value=Default onClick=displayParameter("Steven's Call")>
</td>
</tr>
</table>
</form>
</body>
</html>
I want to display the String when I click Default button but I not able to do so. Instead of ' if I give " or $#.. etc than what I should do to display such type of characters.
<html>
<head>
<title>Eg1.htm</title>
<script language="JavaScript">
function displayParameter(param1)
{
alert("Parameter: " + param1);
}
</script>
</head>
<body>
<form name=form1>
<table border=1 align=center>
<th>Enter A Parameter</th>
<tr><td><input type=text name=text1></td></tr>
<tr>
<td align=center>
<input type=button value=Go onClick=displayParameter(document.form1.text1.value)>
<input type=button value=Default onClick=displayParameter("Steven's Call")>
</td>
</tr>
</table>
</form>
</body>
</html>
I want to display the String when I click Default button but I not able to do so. Instead of ' if I give " or $#.. etc than what I should do to display such type of characters.