Hello, iam developing some site in asp.net using C# and SQL Express. The site deal with digital printing solution, and i have some upload form which handel with files upload for print. In this form there is a few kind of data (like: personal details, pre-print details etc..) there is on line which including fileUpload box, textbox for the name of the job, textbox for the number of copies. I was create 10 lines that the user can upload 10 files but this is not looking so good, My question, How can i show just 1 line and a button like "Add New Line" or "Add new upload" to show new line and so on (so the user can call unlimit numbers of lines)?

I thought i understood what you wanted to do from the Beginning , can you please rephrase your question again.

<input ID="Button4" onclick="Button2_onclick();return false;" type="button" value="Add More" /><br />

and here is the code for script...

<script language="javascript" type="text/javascript">

var NumOfRow=1;

function Button2_onclick()
{
NumOfRow++;

// get the refference of the main Div
var mainDiv=document.getElementById('mainDiv');

// create new div that will work as a container
var newDiv=document.createElement('div');
newDiv.setAttribute('id','innerDiv'+NumOfRow);

//create span to contain the text
var newSpan=document.createElement('span');
newSpan.innerHTML="Enter Url : ";

// create new textbox for email entry
var newTextBox=document.createElement('input');
newTextBox.type='text';
newTextBox.setAttribute('id','txtAddr'+NumOfRow);
//ajaxRequest(p_submitMethod,p_parameters,p_url,p_targetDiv)
// create remove button for each email adress

var newButton=document.createElement('input');
newButton.type='button';
newButton.value='Validate';
newButton.id='btn'+NumOfRow;
var id = NumOfRow;

// append the span, textbox and the button

var myurl = newTextBox.value;

newButton.onclick=function(){ajaxcall(NumOfRow,id);}


newDiv.appendChild(newSpan);
newDiv.appendChild(newTextBox);
newDiv.appendChild(newButton);

// finally append the new div to the main div
mainDiv.appendChild(newDiv);

//newButton.onClick = "ajaxcall(myurl);";


}

please don;t forget to add mainDiv on u r page..

hope this helps..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.