|
|
| |
1. How can i submit the inputs to another script? |
|
Reply |
|
|
 Steffen Zweiniger | 2008-11-09 16:59:42 |
Hi,
for the first: Its a great class.
But now i have a problemm. I developed my form, and it works fine.
I set the following variable $form->ACTION=""; and all the inputs where validated and the form is shown again with my inputs. Now i just wanted to submit the inputs to another script to store them in my database. so i set $form->ACTION="store.php"; .
Whats happening is, the inputs where passed to the store.php, but there is no more validation.
How can i fix this?
I will appreciate for any help.
|
| |
2. Re: How can i submit the inputs to another script? |
|
Reply |
|
|
 Manuel Lemos | 2008-11-09 17:21:58 |
That is why you should present, validate and process the form in the same script.
You do not need to post the form to separate script. Just include your store.php script in your form script where you check whether the form was submitted and validated. |
| |
3. Re: How can i submit the inputs to another script? |
|
Reply |
|
|
 Steffen Zweiniger | 2008-11-10 04:03:53 |
Thanks very much for your fast reply.
I've done this an it works, but there is another problem.
My form contains two date fields generated by the date-class. In my case is this a startdate and the enddate of an event. Its neccesary for me to operate with this dates and validate them, for example between these date must be a range of min. 3 days.
When i select the dates the form them, and in case they are valid dates the form goes ahead.
But i cant check if my two dates have the needed space.
Yes, i can do this check when the form is submitted. But if my validation fails i cannot use the Backbutton, because all the inputs are lost.
So are my questions:
Is there a way to operate with the dates or validate them in more ways before i submit the form (like all other validations)?
Is there a way to avoid that my inputs are lost when the form needs to be loaded again?
Thanks again, i will say a prayer for you...
|
| |
4. Re: How can i submit the inputs to another script? |
|
Reply |
|
|
 Manuel Lemos | 2008-11-10 05:28:59 |
You need to use a custom validation class. Take a look at the test_custom_validation.php script.
If the form has invalid fields you just need to present the form again tothe user instead of processing it. |
| |
5. Re: How can i submit the inputs to another script? |
|
Reply |
|
|
 Steffen Zweiniger | 2008-11-17 13:17:45 |
Thanks,
ok itried to use this for my special validation. But i cnat get i work.
Ok, when i try to verify one input and compare it to a given value, it works.
But i wrote there is the range between the two dates. I can pass the input values of the date-fields to the custom validation file. I can calculate the range between the dates from the input values within the custom validation file.
But the client-validation fails in Firefox, but the Server valiadtion works and validates.
In IE and Chrome i can press the send button, he's gonna disabled and nothing happens. So i think its a problem of the generated javasript, but i cant find out. The values in the javascript seems to be right, but i think there is a problem while the result of the datecalculation is not an input value. Could this be?
As previously mentioned, other simple validations do it, but here i give up.
May i send you the files or publish them here? |
| |
6. Re: How can i submit the inputs to another script? |
|
Reply |
|
|
 Manuel Lemos | 2008-11-18 00:11:47 |
Sure, if the files are small, you can publish here. Otherwise please paste them in a pastebin site.
Make sure you provide both the custom validation class and the example script code. |
| |
7. Re: How can i submit the inputs to another script? |
|
Reply |
|
|
 Steffen Zweiniger | 2008-11-18 06:09:48 |
Thats great. Thank you.
Here the file for the form: http://pastie.org/pastes/317574
and the custom validation: http://pastie.org/pastes/317576
and this is the output: http://pastie.org/pastes/317580
I left the sample custom validation in the file, and it works.
I know the code is no well formatted and its a product of trail and error :-)
Thank your very much for your help. |
| |
8. Re: How can i submit the inputs to another script? |
|
Reply |
|
|
 Steffen Zweiniger | 2008-11-29 01:36:05 |
Ok, no answer. Pity.
However, it works now, but dont know why. The validation error does not appear in the js-alert box. But at the end of all 'normal' validations, it ist displayed above the form. That does it for my demands.
But there is a last problem. I have a field with the validation of an lower and an upper limit. The low limit is fix, but the upper limit varies and comes from the database.
$mylimit = 'get var from database.......';
$form->AddInput(array(
"TYPE"=>"text",
"NAME"=>"count",
"ID"=>"count",
"ValidateAsInteger"=>1,
"ValidationLowerLimit"=>1,
"ValidationUpperLimit"=>$mylimit,
"ValidationErrorMessage"=>"Invalid Count",
"ACCESSKEY"=>"C"
));
But this doesnt work.
How can i get this working?
|
| |
9. Re: How can i submit the inputs to another script? |
|
Reply |
|
|
 Manuel Lemos | 2008-12-03 21:26:03 |
Sorry for the delay. I have been very busy lately.
The problem is that your Javascript code has syntax errors and that prevents the client side validation to be executed.
I suggest that you use Firefox for instance with the Firebug extension so you can easily see and fix the Javascript syntax errors. |
|