Jump to content

onClick

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
ezcat

ezcat

    Learning Programmer

  • Members
  • PipPipPip
  • 39 posts
I'm trying to use onClick to call a PHP script like I can with href.

This line works:
Echo '<td width="100"><div align="center"><a href="olgnsr.php">Name Select</div></a></td>';

I what to do something like this:
Echo '<td width="100"><div align="center"><FORM><INPUT TYPE="button" VALUE="Name Select" onClick="olgnsr.php"></FORM></div></td>';

When I click on the button nothing happens. Is there anyway to get this button to run the olgnsr.php script?

Thanks,
Jon

#2
ezcat

ezcat

    Learning Programmer

  • Members
  • PipPipPip
  • 39 posts
I was able to get what I wanted with this:
Echo '<td width="100"><div align="center"><form name="form1" method="post" action="olgnsr.php"><input type="submit" name="submit" value="Name Select"></form></div></td>';

If anyone has some advice, please let me have it :-)

Thanks,
Jon

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
onClick calls JavaScript. You can modify the contents of the page with JavaScript and use JavaScript to request information from a PHP page.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog