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
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.