Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need straightened out with this function.

Status
Not open for further replies.

imryn

Programmer
Dec 2, 2002
75
0
0
US
Hello Folks,

Okay, Fist I really need a good website that breaks down the properties, methods, and etc for document. something any help would be great? Next, I need someone to tell me where or what it is I am doing wrong here in this script? When I click on the Post Button, nothing happens, and something should be happening, I am trying to execute a function on Post, then that calls formSubmit, which in turn should call a PHP file to do some work and it's not, any clue what's going on here?

Here is my script:

Code:
<html>
 <head>
  <script language="JavaScript">
   function formSubmit(){
    if (document.eventForm.title != "") {
     document.eventForm.method = "post";
     document.eventForm.action = "eventsubmit.php<?=$qstr ?>;}
     document.eventForm.submit();
      }
 else { alert("<?$lang['titlemissing'] ?>"); }
}
</script>
 </head>
 <body>
  <form name="eventForm">
  .
  .  some html code laced with php code.
  .
 <input type="button" value="Post"
  onClick="formSubmit()"> &nbsp;
 <input type="button" value="Cancel" 
  onClicke="window.close();">

Cheers,
imryn
 
Show the final HTML output, without the PHP scripting, so we can see what's being sent to the browser.

Lee
 
One guess is that this line:
Code:
document.eventForm.action = "eventsubmit.php<?=$qstr ?>;}
doesn't have the character string terminated, though without seeing the final output, it's just a guess. And it appears that you have one too many closing curly braces, right at the end of the above line.

Also, if the querystring variable doesn't start with a questionmark, the form action won't be any page on the server since the querystring and page name will be all run together. But those are just guesses.

I think you should use
Code:
else { alert("<?[b][red]=[/red][/b]$lang['titlemissing'] ?>"); }
as well.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top