Jump to content


Form Handling

  • Please log in to reply
1 reply to this topic

#1 vidyashankara

  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 11 July 2006 - 07:52 PM

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?

#2 wakmp

  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 12 July 2006 - 06:25 AM

<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';

Like this ?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users