0

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)?

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by dnanetwork
0

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

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.