Forum Moderators: open
<script type="text/javascript" src="">
function checkurl()
{
url=document.frm1.url;
if ( ( url.value.indexOf('http://')== 0 ) )
{
url = url.value.substr( 7 );
}
else if ( ( url.value.indexOf('http:/')== 0 ) )
{
url = url.value.substr( 6 );
}
else if ( ( url.value.indexOf('http:')== 0 ) )
{
url = url.value.substr( 5 );
}
else if ( ( url.value.indexOf('http')== 0 ) )
{
url = url.value.substr( 4 );
}
else if ( ( url.value.indexOf('://')== 0 ) )
{
url = url.value.substr( 3 );
}
else
{
url = url.value;
}
alert (url);
return true;
}
</script>
<form onsubmit="checkurl();" name="frm1">
<input type="text" maxlength="40" size="30" name="url" />
<input type="submit" value="submit url" />
</form>
This is an easy one and I have done it a long back, now donot remember the way, I am trying. Please help and a fast help will give me a fast relieve.
Thanks once again
Aji
No we donot allow for anything else than www.xyz.com no other pages permitted. Yeah I know there are few guys who turn JS off, Thanks,I will do a php on server side for that as well.
Now another problem please solve it as it is giving me a high time trouble. I am not able to do it.
The problem
I have three rows in a table and two option(Radio button) Admin1 and Admin 2.
row 1) Enter Name
row 2) Enter URL
row 3) Enter Password.
Now here, when I click admin 1, row 1) and row 3) should displayed. When click admin 2, row 2 and row 3) should display. This part is done using div for each content inside each cell.
How can do it for a complete row.I mean just hide one row and allow other.
Please Help.
Thanks
Aji
<tr id="row2"><td>URL</td></tr>
document.getElementById("row2").innerHTML = "<td>Password</td>"
(Disclaimer - I've used innerHTML many times, but never to rewrite table cells. I've no idea how the browser's rendering engine will cope with changing table content since tables are rendered all-at-once after all the sizing calculations are complete.)