-
How to call a javascript function from click button in another javascript function?
<html>
<head>
<script type="text/javascript">
function call()
{
design()
}
function design()
{
document.write("<center>")
document.write("User Name:<input type='text'>"+'<br><br>')
document.write("Password:<input type='text'>"+'<br><br><br>')
document.write("<input type='button' value='Submit' onclick='javascript:ssubmit()'>")
document.write("</center>")
}
function ssubmit()
{
document.write("Thank u For Your Registration")
}
</script>
</head>
<body>
<a href="javascript:call()">Click Me</a>
</body>
</html>
-
I have tried this code and the function Design() click event that should call the ssubmit() function does nothing. Can any body help please?
-
You cannot use document.write AFTER the page has been rendered.
Doing so, will re-write the page to original conditions and reset your entry.
note also that call() is a reserved word in javascript.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks