General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old December 10th, 2002, 06:04 PM
papasmurf papasmurf is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 10 papasmurf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
can you do this?

im assuming you can but im not sure and i can't seem to get it to work but i want the aciton of a form to go to a function that checks it for completeness.

action="checkForm()"

checkForm()
{
if ($isset($var)) :
...
}

something to that effect...

Reply With Quote
  #2  
Old December 10th, 2002, 06:18 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
the action command inside a form tag is client side and the function is php, so you cant actually do that

Reply With Quote
  #3  
Old December 10th, 2002, 10:13 PM
eloso eloso is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 6 eloso User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I guess what you're trying to do is to check the validity of a form BEFORE sending it to the server side.

For that, you can use some javascript

i.e. :
function checkItOut() {
whatever statement;
if (notVerified)
return false;
else
return true;
}


And validate the form before it gets sent to the server

i.e. : <form onSubmit="return checkItOut();">

ciao!

Reply With Quote
  #4  
Old December 10th, 2002, 11:17 PM
papasmurf papasmurf is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 10 papasmurf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
what about action="<? checkForm() ?>"????

Reply With Quote
  #5  
Old December 11th, 2002, 12:13 PM
eloso eloso is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 6 eloso User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Nop!

you cannot do <form action="<? action() ?>">
It is not on the same side of the network.

The form tag is processed by the browser (client side) and
the <? action() ?> is processed on the server side.

Actually, you COULD write <form action="<? action() ?>"> but the result will not be as expected (the action() function will not validate the form). It will only put nothing in the action tag.

So the browser will parse <form action=""> and send the whole form to the curent page (but to the server.)

But maybe you would like to try passing a hidden form field to the script you're calling (if action="" => curent page script) with the function name (i.e. <input type="hidden" name="funct" value="action").

And then, in the script that receive that form, you could call the desired function with something similar to :

$funcName = $HTTP_POST_VARS["funct"];
if (function_exists($funcName)) $funcName();

hope that will help !

ciao!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > can you do this?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway