Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.