943,568 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 1201
  • PHP RSS
You are currently viewing page 1 of this multi-page discussion thread
Dec 23rd, 2008
0

need help in php forms..plz

Expand Post »
hi there ...

i want to Handel a select field in php but i could not ..so i was wondering if someone can help....


what i want is there will numbers from 3 to 40 listed in select field and when user select 3
3 text box will appear and if he select 10 then 10 box appear ....and so on

thanks in advance...
Reputation Points: 10
Solved Threads: 0
Light Poster
wwwmadeasy is offline Offline
38 posts
since Dec 2008
Dec 23rd, 2008
0

Re: need help in php forms..plz

What have you tried? Please post your existing code.

And a small hint would be for you to use the value from the select box in a for loop...

R.
Reputation Points: 101
Solved Threads: 74
Posting Pro in Training
blocblue is offline Offline
427 posts
since Jan 2008
Dec 23rd, 2008
0

Re: need help in php forms..plz

PHP Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <script language="JavaScript">
  4. function make_textbox(no)
  5. {
  6. if(no < 1)
  7. return false;
  8.  
  9. var my_textbox = "";
  10.  
  11. for(var i=0;i<no;i++)
  12. {
  13. my_textbox += "<br>Text Box "+eval(i+1)+": <input type='text' name='textfield["+i+"]'>";
  14. }
  15.  
  16. document.getElementById("text_id").innerHTML = my_textbox;
  17. }
  18.  
  19. </script>
  20. </head>
  21.  
  22. <body>
  23.  
  24. <form name="myfrm">
  25.  
  26. Select Number Of TextBox : <select name="select_num_text" onChange="JavaScript:make_textbox(this.value);">
  27. <option value="">Select</option>
  28. <?php
  29.  
  30. for($i=3;$i<=40;$i++)
  31. {
  32. echo "<option value='".$i."'>".$i."</option>";
  33. }
  34. ?>
  35. </select>
  36. <br>
  37. <div id="text_id"></div>
  38. </form>
  39. </body>
  40. </html>
Reputation Points: 10
Solved Threads: 5
Light Poster
manish.s is offline Offline
29 posts
since Dec 2008
Dec 23rd, 2008
0

Re: need help in php forms..plz

dear Manish Singh

thanks a lot man for this ..it was what i am looking for thanks man ...
Reputation Points: 10
Solved Threads: 0
Light Poster
wwwmadeasy is offline Offline
38 posts
since Dec 2008
Dec 23rd, 2008
0

Re: need help in php forms..plz

Always Welcome....
Reputation Points: 10
Solved Threads: 5
Light Poster
manish.s is offline Offline
29 posts
since Dec 2008
Dec 23rd, 2008
0

Re: need help in php forms..plz

and another one with jQuery ( my suggest : learn it!!

preview: http://lostinchevrolet.co.cc/wp-cont...ds/wwwmadeasy/

download: http://lostinchevrolet.co.cc/wp-cont...wwwmadeasy.zip
Reputation Points: 10
Solved Threads: 1
Newbie Poster
jesirobendebua is offline Offline
1 posts
since Dec 2008
Dec 23rd, 2008
0

Re: need help in php forms..plz

Do you want same out put using jquery ?
if yes i will be happy to help...
Reputation Points: 10
Solved Threads: 5
Light Poster
manish.s is offline Offline
29 posts
since Dec 2008
Dec 23rd, 2008
0

Re: need help in php forms..plz

thanks to Manish Singh he totaly solve my problem
Reputation Points: 10
Solved Threads: 0
Light Poster
wwwmadeasy is offline Offline
38 posts
since Dec 2008
Dec 23rd, 2008
0

Re: need help in php forms..plz

Manish Singh one more thing how i can submit these data to database? thanks in advance
Reputation Points: 10
Solved Threads: 0
Light Poster
wwwmadeasy is offline Offline
38 posts
since Dec 2008
Dec 23rd, 2008
0

Re: need help in php forms..plz

Please let me know structure of your table.
Reputation Points: 10
Solved Threads: 5
Light Poster
manish.s is offline Offline
29 posts
since Dec 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: DIV Help
Next Thread in PHP Forum Timeline: Urgently need -php script for searching image





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC