Hello,
the user enters details into a form (values.php) whose action is (insert_values. php), where does the server-side validation code go?
(I know other posts on this subject say use PHP_SELF for the action but I don't want to redo all the code)
Where should I put the code? I tried it myself but neither way worked so probably the code is wrong for this but I know it works using the PHP_SELF method......
User Profile
Collapse
-
Which script should contain the server-side validation code?
-
The problem seems to be that even if the JS function finds an empty field and displays an alert box it will submit the form when you click 'ok'.
I need the function to let me correct the error then submit the form
...Code:if(isEmpty(valp, "Please enter a value")) { return true; function isEmpty(elem, helperMsg) { if(elem.value.length == 0) { alert('Please -
Do you mean this:
[html]<input type="submit" value="Add Observations" />[/html]
because that won't let me submit the form even if its okLeave a comment:
-
thanks for the replies, I didn't get it to work but I went round the problem.
i saw the function, thanks, but I wanted to know how to fix that specific problem.
of course I have a new problem now with JS form validation
avaialble at: http://www.thescripts.com/forum/show...20#post2492320 if anyone's interested.Leave a comment:
-
JS: What does this code need to validate & submit (not 1 or the other)
Hello,
I have been trying to get this JS form validation code to work ad nauseam... it won't validate, stop if required and submit. The best I managed was to get it to display an empty field alert but still submit.
I think the problem lies with the form syntax but I tried different variations and still couldn't get it to work properly; the code is here:
...Code:function formValidator() { var firstname -
thanks for the replies but the problem remains:
[php]
$query = "SELECT * FROM hcffres WHERE residentid = $var";
mysql_query($qu ery);
// I need to know what command goes here
echo"<form action=....
[/php]
what is the command I need to output the data returned from the query into the html form so the user can alter the field that needs updating
here's hoping...Leave a comment:
-
How do I use a variable to fill a form with MySQL record data?
Hello,
I am trying to make a PHP/HTML update script for MySQL.
I prompt the user to enter the ID# of the record they wish to update into a form which then uses the passed ID# to select the associated record from the database:
Code:$id = @$_GET['q'] ;
How do I output the data from the query...Code:$query = "SELECT FROM Hcffres WHERE residentid = $id"; mysql_query($query);
No activity results to display
Show More
Leave a comment: