submit a joomla form via javascript

hi am trying to submit a page from a javascript code can get the java to run ok but cannot get the page to submit from the javascript call
can any one give me a heads up please


<form name="{$frmname}" method="get" action="index.php?"><input
      type="text" name="option" value="com_content" /><input type="text"
      name="view" value="article" /><input type="text" name="id"
      value="15" /><input type="text" name="Itemid" value="31" />
      
<p></p>


<script type="text/javascript">
<!--
function popup() {
      alert(document.getElementById('typeclient').value);
      
    alert("Hello World");
      // alert($frmname);
      // document.{$frmname}.submit();
      var gettag = document.getElementById ("frmname:page");
      alert(gettag);
frmName.submit(frmName);  ??????

}
//-->
</script>
<input type="button" onclick="popup()" value="popup">
sydneyguyAsked:
Who is Participating?
 
Abhijeet RananawareConnect With a Mentor Web & Mobile DeveloperCommented:
First of all ..are you trying to submit in front end or backend ?

Give form name "adminForm"

Have you included joomla.javascript.js ?

Regards.
abhijit
0
 
Abhijeet RananawareWeb & Mobile DeveloperCommented:
For Saving

frmName.submitbutton('save')

For Cancel

frmName.submitbutton('cancel')


This should work

Regards,
Abhijit
0
 
sydneyguyAuthor Commented:
does not run still will not submit
do i need to have the real form name in place of frmName??
0
 
sydneyguyAuthor Commented:
the java script is working ok
<form name="{$frmname}" method="get" action="index.php?"><input
were {$frmname} is null but looks like the name is not required as it uses
type="text" name="option" value="com_content" /><input type="text"
      name="view" value="article" /><input type="text" name="id"
      value="15" /><input type="text" name="Itemid" value="31" />

for the index selection of what to do with it
so have named the page does not seem to affect its operation and then the below line and now it works fine. so just need to verify the inputs and its right to go thanks for the help happy xmas

document.forms["abcform"].submit();
0
 
Abhijeet RananawareWeb & Mobile DeveloperCommented:
Glad you found solution..

Merry Christmas
Abhijit
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.