Jump to content

Archived

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

vidyashankara

Form Handling

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?

Share this post


Link to post
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 ?

Share this post


Link to post
Share on other sites

×

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.