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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using PHP function with OnClick=

Status
Not open for further replies.

Thomas001

Programmer
Jun 24, 2004
29
US
How would I go about using a PHP function I've coded with the Onclick= field on my button?
 
you cant. Your talking client side trying to act with server side. What exaclty are you trying to do, we will help you with a solution.

___________________________________
[morse]--... ...--[/morse], Eric.
 
Basicly I'm trying to run through a list of form fields and see what hasn't been filled out.

I thought I'd try doing it with a function in PHP and set some bool variables to reload the page and have something like this:

under the inappropriate fields print("* fill this field out").


^_^field box here^_^
if ($noname)
print("fill this fieldout");
else
print("maybe a hint for newbies");
 
What you will do is have the form submit to a PHP script. That script will check the user-provided values and provide a refreshed version of the form which gives the user error messages.

Without submitting the form, you can't get PHP to work on the values.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top