Jump to content

Help needed in form method


bishnu.bhatta

Recommended Posts

Hi,

 

I am new to PHP and got a silly doubt.

 

My friend has designed a form in which there are a lot of hidden and visible fields.When I click submit, the form is posted to some URL.Now that the count of the fields used is more than 20, so I am unable to analyze whats happening.

 

Is there a way to capture all the values from the form before it is posted??? My analysis process should not hamper the usual functionality of the form.

 

Thanks in advance

Bishnu Bhatta

Link to comment
https://forums.phpfreaks.com/topic/161997-help-needed-in-form-method/
Share on other sites

Maq:

 

Let me put my scenario in a simpler way....

 

My forum has a login page where users need to sign in.

So the form method says: on submit action = abc.php

 

But I want to capture all the login IDs, even the invalid attempts before the submit action.

 

I belive ,I have to do something simlar to this(I don't want this method):

1.Capture the ID using javascript before the submit action

2.pass it to say preprocess.php

3.In preprocess.php, I have to use another method to pass it to abc.php

 

 

I want to capture and save it in a table before the form passes it to abc.php

 

Hope i was able to explain the scenario properly.

In the <form> command, put onsubmit="Anal(this)"

 

and Anal() should be

 

function Anal(ID)
{
for (i=0; i<ID.elements.Legnth; i++)
{
Element = ID.elements[i]
alert(Element.name + "=" + Element.value)
}
}

 

There could be some errors in that JS, it's been a while since I've written something like that

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.