House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

cfajax - why is the form being submitted?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
I've got this:
Greg Morphis
08/03/12 12:13 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Greg Morphis
08/03/2012 12:13 PM

I've got this: <cfajaxproxy cfc="proxy" jsclassname="proxy" /> <script> function verifyArticleClick(gid) { var instance = new proxy(); instance.setCallbackHandler(verifyArticleSuccess); instance.verifyArticle(gid); } function verifyArticleSuccess(result) { document.getElementById('title').value = result; } </script> ... <tr><td><strong>Presentation Title:</strong></td><td><input type="text" name="title" id="title" value="<cfoutput>#form.title#</cfoutput>" size="40" maxlength="255"></td></tr> <tr><td><strong>Presentation ID:</strong></td><td><input type="text" name="article_gid" id="article_gid" maxlength="40" size="40" value="<cfoutput>#form.article_gid#</cfoutput>" /> <button name="getArticleTitle" onClick="verifyArticleClick(getElementById('article_gid').value)" class="green">Verify</button><br /> * Please enter the Article ID for this presentation</td></tr> ... when I click Verify the form submits.. If I put an onsubmit="return false;" in the <form line then it displays the correct result.. Why is the form being submitted? Thanks

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Greg Morphis
08/03/2012 12:26 PM

the <button> tag was submitting the form... I changed that to <input type="button" and it works. ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 20, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference