Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.
Moderator: General Moderators
erbrmn
Forum Newbie
Posts: 3 Joined: Wed Dec 17, 2008 2:39 pm
Post
by erbrmn » Wed Dec 17, 2008 2:52 pm
There are 2 buttons, I want to submit forum from javascript code.
It is not work, how can I submit when I have several buttons in single forum, please advice me.
Code: Select all
<html>
<head>
<script language="JavaScript">
<!--
function funcSubmitform(p_url) {
if (confirm("Really ?"))
{
frmMain.action = p_url;
frmMain.submit();
return true;
} else {
return false;
}
}
//-->
</script>
</head>
<body>
<form method="POST" name="frmMain">
<div align="center">
<table border="0" width="100%" border="0" cellpadding="6" cellspacing="1">
<tr>
<td class="title">ID :</td>
<td class="item"><input name="txtUserID" value="" tabindex = "1" type="text" size="40" /></td>
</tr>
<tr>
<td height="50" colspan="2" align="center" class="item">
<input type="button" name="btnREG" value="UPDATE" onclick="funcSubmitform('file1.php');">
<input type="button" name="btnDEL" value="DELETE" onclick="funcSubmitform('file1.php');">
</td>
</tr>
</table>
</div>
</form>
</body></html>
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Wed Dec 17, 2008 4:38 pm
Try changing
to
Better yet, google has
ALOT to say on the matter
erbrmn
Forum Newbie
Posts: 3 Joined: Wed Dec 17, 2008 2:39 pm
Post
by erbrmn » Wed Dec 17, 2008 4:59 pm
Yes , I tried like this ,
also I searched from google.com, ..... but I still can not submit.
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Wed Dec 17, 2008 6:19 pm
Does this example work?
Code: Select all
<script language="javaScript">
function SubmitForm()
{
document.form1.submit();
}
</script>
<form name="form1" action="anotherpage.html">
<a href="#" onclick="SubmitForm()">Test Link</a>
</form>
erbrmn
Forum Newbie
Posts: 3 Joined: Wed Dec 17, 2008 2:39 pm
Post
by erbrmn » Thu Dec 18, 2008 5:32 pm
Jcart:
Thank you for advices, but I still can not submit it when I use normal link.
When I submit to normal html file It can link but not like real submit, I can not submit php file.
Have you any idea?