Forum : Sir,I am not able to reverse the string.Kindly help me out....
Brief description  about Online courses   join in Online courses
View Sweety  Agarwal 's Profile

Sir,I am not able to reverse the string.Kindly help me out....

<html>
<head>
<title>Variable Assignment</title>
<style type="text/css">
h1
{
font-size:30px;
font-family:"Comic Sans MS", cursive;
text-align:center;
color:#4AA02C;
}

body
{
background-color:#FDD017;
}

td
{
font-size:20px;
color:#7E2217;
}

.padding
{
padding-left:30px;
}

.float
{
float:left;
}
#float
{
float: right;
}
</style>

<script type="text/javascript">
function calculate()
{
a=document.form1.first.value;
b=document.form1.second.value;
c=(a b);
document.form1.result.value=c;
}
function rev()
{
a=document.form1.first.value
document.form1.afterreverse.value=a.reverse()
}

</script>
</head>
<body>
<h1><u>Variable Assignment</u></h1><br/><br/>
<form name="form1">
<table class="float" border=0>
<tr>
<td>String1:</td>
<td class="padding"> <input type="text" name="first" /></td>
<tr>
<td>String2:</td>
<td class="padding"><input type="text" name="second" /></td>
</tr>
<tr>
<td>Result: </td>
<td class="padding"><input type="text" name="result" /></td>
</tr>
<tr align=center>
<td><input type="button" value="Concatenate" onClick=calculate() /></td>
<input type="button" value="Reverse" onClick=rev() />
<input type="text" name="afterreverse"/>
</tr>
</form>
</table>

<form id="form2">
<table id="float">
<tr>
<td>Enter First Number:</td>
<td class="padding"> <input type="text" name="firstname" /></td>
<tr>
<td>Enter Second Number:</td>
<td class="padding"><input type="text" name="secondname" /></td>
</tr>
<tr>
<td>Total: </td>
<td class="padding"><input type="text" name="total" /></td>
</tr>
<tr>
<td align="center" colspan=2>
<input type="button" name="submit" value=" " />
<input type="button" name="submit" value="-" />
<input type="button" name="submit" value="*" />
<input type="button" name="submit" value="%" />
</td>
</tr>
</form>
</table>
</body>
</html>
Asked by Sweety Agarwal | Oct 11, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Sweety,

Already replied to this query.
Oct 11, 2010