Jump to content

easy query!


kadamsurekha

Recommended Posts

hello friends!

 

i have  a query here with ajax and php

 

i have a page where i want to show records based on no. selected

 

like

 

i have a drop down list which allows to select the no:

like 1,2,3,4,5

so if user selects 1 he should get 1 textbox displayed down

if user selects 2 he should get 2 textboxes displayed

 

and so on

 

i m not understanding the code how to write for this to work

 

i hav written it as follows:

 

<html>

<head>

<script language="javascript">

function chkselect()

{

        rows = document.ninvites.options[selectedIndex].value;

if(rows==1)

        {

              document.getElementById.Layer1.innerHTML="<input type=text name=s1>";

        }

 

}

</script>

<body>

<div id="Layer1">

 

ENTER NO OF INVITATIONS:

<select name="ninvites" onchange="javascript:chkselect();">

      <option value="1">1</option>

      <option value="2">2</option>

      <option value="3">3</option>

      <option value="4">4</option>

      <option value="5">5</option>

</select>

</div>

</body>

</html>

 

 

 

i want the textboxes to get displayed below the dropdown list.

 

 

can any1 help me in this??????????????

Link to comment
https://forums.phpfreaks.com/topic/51445-easy-query/
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.