|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
cfajax - why is the form being submitted?
I've got this:Greg Morphis 08/03/12 12:13 P the <button> tag was submitting the form... I changed that to <inputGreg Morphis 08/03/12 12:26 P 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 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 -----
|
May 20, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||