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
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
Share on other sites

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.