Jump to content

Form Handling


vidyashankara

Recommended Posts

I have 2 scripts.  A.php and B.php

In A.php,
I have 3 text fields.

and in B.php,
i have the script read these text fields and perform certain operations

Now the problem is, in A.PHP, if the users wants to do multiple functions, he should be able to do it

for eg.
As soon as the user fills out the 3 text fields, 3 more should turn up automatically and once he fills those, 3 more should turn up and so on.
and when he clicks submit, the script should takes all the values and give it to B.php

I heard you can do it only with javascript. how do you do it? is this possible?
Link to comment
https://forums.phpfreaks.com/topic/14323-form-handling/
Share on other sites

<input type='text' name='field1' id='field1' onblur='check();'><br>
<input type='text' name='field2' id='field2' onblur='check();'><br>
<input type='text' name='field3' id='field3' onblur='check();'><br>
<input type='text' name='field4' id='field4' style='display:none;'><br>
<input type='text' name='field5' id='field5' style='display:none;'><br>
<input type='text' name='field6' id='field6' style='display:none;'>
<script language='javascript'>
function check(){
if(field1.value != '' && field2.value != '' && field3.value != ''){
field4.style.display = 'block';
field5.style.display = 'block';
field6.style.display = 'block';
}
}
</script>


Like this ?
Link to comment
https://forums.phpfreaks.com/topic/14323-form-handling/#findComment-56620
Share on other sites

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.