Welcome to Dream.In.Code
Getting Help is Easy!

Join 131,730 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,229 people online right now. Registration is fast and FREE... Join Now!




java script forms

 
Reply to this topicStart new topic

java script forms, help my function will not come if i call it

Rastafubu
post 2 Oct, 2008 - 12:00 AM
Post #1


New D.I.C Head

*
Joined: 1 Oct, 2008
Posts: 2

this is my html code

CODE
<td width="676"><span id = 'regisform'>
<h2>Now try our wonderful Beijing Olympic Quiz!</h2>
<p>Did you enjoy the Beijing Olympics?<br /><br />
It's time for reviewing facts on the Beijing Olympics.<br /><br />
To try this quiz, you need to provide your profile for generating a personal certificate.<br />

</p>
<p align="center"><a href="#" onclick="displayRegistrationForm()">Click here for registration</a></p>
</div>
      </div>
</span></td>
      
    </tr>
</table>



my JS code
CODE


function displayRegistrationForm()
{
var strHTML = "<h2>Registration for Beijing Olympic Quiz:</h2><br />Fill in the following form: <br /><form action=\"\" name=\"regForm\" method=\"post\" id=\"regForm\">Name <input type=\"text\" name=\"name\" /><br />Email <input type=\"text\" name=\"email\"/><br /><br /><input type=\"button\" id=\"btSubmit\" value=\"Submit Query\" onclick=\"validateSubmission()\" /><br /><input type=\"button\" value=\"Reset\" onclick=\"java script:document.regForm.reset();\" /></form>";
document.getElementById('regisform').innerHTML = strHTML;
}


This post has been edited by Rastafubu: 2 Oct, 2008 - 12:17 AM
User is offlineProfile CardPM

Go to the top of the page

Jayman
post 2 Oct, 2008 - 10:02 AM
Post #2


Student of Life

Group Icon
Joined: 26 Dec, 2005
Posts: 6,827



Thanked 38 times

Dream Kudos: 500

Expert In: C#, VB.NET, Java

My Contributions


Moved to Javascript forum.
User is online!Profile CardPM

Go to the top of the page

mocker
post 2 Oct, 2008 - 10:15 AM
Post #3


D.I.C Regular

Group Icon
Joined: 14 Oct, 2007
Posts: 256



Thanked 14 times
My Contributions


Use Firefox's Error Console or Chromes Javascript Console to load the page and see what errors it shows. If you have broken javascript elsewhere on the page it won't load that function, so just pasting this specific part doesn't help.

That part of the code looks fine, though I didn't go through and check every double quote was escaped properly in your string.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/20/08 10:36AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month