[karsten samaschke]

ASP.NET daily. Or weekly.

How to access values of dynamically created TextBoxes

If one adds controls dynamically to a page and wants to get their information after PostBack, one needs to recreate these elements after the PostBack. Let's consider the following idea: First you create some controls:

   for(int i=0;i<10;i++) {
      TextBox objBox = new TextBox();
      objBox.ID = "objBox" + i.ToString();
      this.Page.Controls.Add(objBox);
   }

After PostBack, you want to retrieve the text entered in the third TextBox. If you try this:

   String strText = objBox2.Text;

you'll receive an exception. Why? Because the boxes have not been created again and the local variable objBox2 simply not exists.

How to retrieve the Box?

You'll need to recreate the box by using the code above. Then, you may try to get its value by using the following code:

   TextBox objBox2;
   objBox2 = this.Page.FindControl("objBox2") as TextBox;
   if(objBox2 != null)
      Response.Write(objBox2.Text);

Try it and take a look at the result. Did it work well for you?

Comments

Paul Wilson said:

Its all about timing and the page lifecycle. Posted values are only restored in one of two very specific internal page methods. The first attempt to restore posted values occurs immediately after loading viewstate and before the load event. The second attempt, if needed, occurs immediately after the load event and before the changed/clicked events. If you want your dynamic control's posted values to be available in the load event, like all other controls, then you will have to recreate it before the load event, not in it. The best place to create them would be in the Init event, but I've found you can also create them in an override of LoadViewState after a call to the base method, which works great for scenarios where you have to dynamically figure out what to dynamically create based on values you already stored in ViewState. Anyhow, the point is that if you recreate you dynamic controls in the Load event, then you will not be able to see their posted values until the next phases of the page lifecycle.

See http://www.ASPAlliance.com/PaulWilson/Articles/?id=6 for more.
# April 28, 2003 12:21 AM

ANILKUMAR_BANGALORE said:

This will throw error ,
With out runat= server you cannot load a control on a page
# December 8, 2003 12:05 AM

g said:

jjggjgjgj
# January 12, 2004 7:26 AM

Dwaraka k.p said:

Hi,

Actually I am creating HtmlTextArea and webcontrol radiobutton dynamically.

There might me n number of these, There is no limitation. And I am giving paging manually.

Now I am unable to access the values of both

Please help me.

Thanx in advance.
dwaraka k.p
# January 27, 2004 12:17 PM

Pad said:

What if We want to retrieve the text entered in the all the 10 TextBoxes?

Please Help me?

Thanks.
# February 6, 2004 4:20 PM

Ng Chee Meng said:

I am sorry, but it seems like it cannot work, i am using asp.net and the error is

System.NullReferenceException: Object reference not set to an instance of an object.
# March 24, 2004 1:26 AM

Farzin said:

great works perfect for me thanks!
# April 2, 2004 11:24 AM

Bob said:

I got the same problem. An other solution :
Handle each control dynamically with the TextChanged method, and each time the text is changed, use view state to stock it.
But I don't know how to do that!!
# June 18, 2004 3:49 AM

Hedeci said:

yemiyor kardesim bu. yemiyor...
# June 24, 2004 1:17 PM

Dave Coates said:

I also had the error:

"System.NullReferenceException: Object reference not set to an instance of an object. "

I have dynamically created controls on my page and assigned each a string together with the number of the control as ID by using for loop. To recover the values I use another FOR loop to retrieve them, I hope it makes sense:

string[] strTextBoxValues = new string[] {};

for (int k = 1; k <= iCount - 1; k++)

       {

           //Create ID as it was assigned when controls where Created

           strControlName = "DynamicTextBox" + k;

           TextBox objTextBox = (TextBox)PnlControlPanel1.FindControl(strControlName);

        strTextBoxValues[k] = objTextBox.Text;

       }

Hope that helps someone.

# May 16, 2007 10:21 AM

jasmine said:

hi pad,

if u have created the textboxes dynamically,

then check if the below piece of code works fine with u

 protected void Button1_Click(object sender, EventArgs e)

   {

       IterateControls(this);

   }

   public void IterateControls(Control parent)

   {

       int i = 0;

     foreach (Control child in parent.Controls)

      {

   if (child.GetType().ToString().Equals("System.Web.UI.WebControls.TextBox")

         && child.ID.IndexOf("txt_") == 0)

   {

     TextBox textbox = (TextBox)child;

     //globally declared array of string

       s[i]=textbox.Text;

       i++;

   }

   if (child.Controls.Count > 0)

   {          

     IterateControls(child);          

   }

 }

   }

# August 26, 2007 3:54 AM

Mike C. said:

In the last line....

this.Page.Controls.Add(objBox);

change to

Placeholder1.Controls.Add(objBox)

Add the placeholder control in design view...

# March 19, 2008 3:14 PM

Barbaros said:

I have a dropdownlist, autopostback is enabled, filled in the codebehind  and a Table which has an Id an Runat="server" attribute(just table, rows and cells will be created based on dropdownlist)

I am using Table as a placeholder for the controls which will be created based on the dropdownlist changed index.

When user changes the selected value i am creating cells and rows for the table and then add textbox controls to cells..

And i have asp:button. On click event i am trying to get the values of the textboxes. But i can't :S

Please someone help, i have read all the articles and try everything where am i doing wrong?

# October 23, 2008 4:50 AM

Balaji said:

Nice blog.

We can access values using client side javascript also.

Then which one is best?

Client side or server side?

# December 3, 2008 5:01 AM

sohiab said:

for(int i=0;i<100;i++)

{

cout<<"Hello World"<<endl;

}

# August 27, 2009 3:42 PM

esteban said:

i create dynamic controls. textbox and radio buttons. but when i click submit, i cant access their values from the code behind, so any response i enter in the textboxes or radio buttons is lost.

what is the best way to capture the responses?

# September 1, 2009 7:13 PM

PRERNA said:

HOW TO DO IT USING JAVASCRIPT

# November 18, 2009 6:35 AM

shijobaby500 said:

Acessing Dynamically added HTML Element on server side.

htmlerror-info.blogspot.com/.../accessing-controls-created-dynamically.html

# December 8, 2009 8:52 AM

kalpesh said:

<td><input name="ctl00$ContentPlaceHolder1$TextBox00" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox00" onblur="txt_onblur(0,0,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden00" id="ctl00_ContentPlaceHolder1_Hidden00" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox01" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox01" onblur="txt_onblur(0,1,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden01" id="ctl00_ContentPlaceHolder1_Hidden01" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox02" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox02" onblur="txt_onblur(0,2,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden02" id="ctl00_ContentPlaceHolder1_Hidden02" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox03" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox03" onblur="txt_onblur(0,3,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden03" id="ctl00_ContentPlaceHolder1_Hidden03" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox04" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox04" onblur="txt_onblur(0,4,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden04" id="ctl00_ContentPlaceHolder1_Hidden04" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox05" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox05" onblur="txt_onblur(0,5,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden05" id="ctl00_ContentPlaceHolder1_Hidden05" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox06" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox06" onblur="txt_onblur(0,6,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden06" id="ctl00_ContentPlaceHolder1_Hidden06" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox07" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox07" onblur="txt_onblur(0,7,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden07" id="ctl00_ContentPlaceHolder1_Hidden07" value="0" /></td>

</tr><tr>

<td><input name="ctl00$ContentPlaceHolder1$TextBox10" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox10" onblur="txt_onblur(1,0,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden10" id="ctl00_ContentPlaceHolder1_Hidden10" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox11" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox11" onblur="txt_onblur(1,1,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden11" id="ctl00_ContentPlaceHolder1_Hidden11" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox12" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox12" onblur="txt_onblur(1,2,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden12" id="ctl00_ContentPlaceHolder1_Hidden12" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox13" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox13" onblur="txt_onblur(1,3,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden13" id="ctl00_ContentPlaceHolder1_Hidden13" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox14" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox14" onblur="txt_onblur(1,4,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden14" id="ctl00_ContentPlaceHolder1_Hidden14" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox15" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox15" onblur="txt_onblur(1,5,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden15" id="ctl00_ContentPlaceHolder1_Hidden15" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox16" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox16" onblur="txt_onblur(1,6,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden16" id="ctl00_ContentPlaceHolder1_Hidden16" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox17" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox17" onblur="txt_onblur(1,7,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden17" id="ctl00_ContentPlaceHolder1_Hidden17" value="0" /></td>

</tr><tr>

<td><input name="ctl00$ContentPlaceHolder1$TextBox20" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox20" onblur="txt_onblur(2,0,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden20" id="ctl00_ContentPlaceHolder1_Hidden20" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox21" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox21" onblur="txt_onblur(2,1,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden21" id="ctl00_ContentPlaceHolder1_Hidden21" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox22" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox22" onblur="txt_onblur(2,2,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden22" id="ctl00_ContentPlaceHolder1_Hidden22" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox23" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox23" onblur="txt_onblur(2,3,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden23" id="ctl00_ContentPlaceHolder1_Hidden23" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox24" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox24" onblur="txt_onblur(2,4,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden24" id="ctl00_ContentPlaceHolder1_Hidden24" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox25" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox25" onblur="txt_onblur(2,5,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden25" id="ctl00_ContentPlaceHolder1_Hidden25" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox26" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox26" onblur="txt_onblur(2,6,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden26" id="ctl00_ContentPlaceHolder1_Hidden26" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox27" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox27" onblur="txt_onblur(2,7,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden27" id="ctl00_ContentPlaceHolder1_Hidden27" value="0" /></td>

</tr><tr>

<td><input name="ctl00$ContentPlaceHolder1$TextBox30" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox30" onblur="txt_onblur(3,0,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden30" id="ctl00_ContentPlaceHolder1_Hidden30" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox31" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox31" onblur="txt_onblur(3,1,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden31" id="ctl00_ContentPlaceHolder1_Hidden31" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox32" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox32" onblur="txt_onblur(3,2,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden32" id="ctl00_ContentPlaceHolder1_Hidden32" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox33" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox33" onblur="txt_onblur(3,3,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden33" id="ctl00_ContentPlaceHolder1_Hidden33" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox34" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox34" onblur="txt_onblur(3,4,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden34" id="ctl00_ContentPlaceHolder1_Hidden34" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox35" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox35" onblur="txt_onblur(3,5,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden35" id="ctl00_ContentPlaceHolder1_Hidden35" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox36" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox36" onblur="txt_onblur(3,6,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden36" id="ctl00_ContentPlaceHolder1_Hidden36" value="0" /></td><td><input name="ctl00$ContentPlaceHolder1$TextBox37" type="text" value="0" id="ctl00_ContentPlaceHolder1_TextBox37" onblur="txt_onblur(3,7,4,8);" style="Position:Absolute;Width:60px;Height:20px;" /><input type="hidden" name="ctl00$ContentPlaceHolder1$Hidden37" id="ctl00_ContentPlaceHolder1_Hidden37" value="0" /></td>

</tr>

# December 11, 2009 3:20 AM

Suraj Shrestha said:

You can access values of textbox from request parameters

like

Request.Form["textbox ID"];

# December 28, 2009 5:51 PM

Saurabh said:

Suraj has suggested the simplest solution.

No matter how many dynamic contrils are created,

all you need is to ensure unique combination to be assigned as id for your controls and you can use Request.Form["textbox ID"];

for accessing the control's value.

# July 30, 2010 5:12 AM

alaaseada said:

I use the Request.Form[TextBoxID] to insert the entered value into databse ...but it is always null

# August 9, 2010 7:00 AM

skateboard art said:

I recently came throughout your site and occur to become understanding along. I assumed I'd personally leave my initial comment. I seriously do not know what  to say except that We've loved examining. Respectable net site. I am going to maintain visiting this weblog really frequently.

--------------------------------------------

my website is <a href="zeroskateboards.org/.../skateboard-art.html">skateboarding art</a> .Also welcome you!

# December 4, 2010 9:05 PM

Hand yoga said:

"This is truly my really 1st time here, and that i should say this is a genuinely wonderful site. I have uncovered lots of fascinating stuff inside your website specifically in its  discussion. From all of the wonderful comments in your articles or blog posts, it appears like that is a really effectively preferred net web page. Maintain up the wonderful work."

--------------------------------------------

my website is  

http://polarwatches.info

Also welcome you!

# December 7, 2010 12:13 AM

abc news ipad app said:

Variety is the spice of life.

-----------------------------------

# December 17, 2010 11:29 PM

ipad stand said:

-----------------------------------------------------------

i would need to say.! stats are a ache in the arse. i necessarily mean most stat web-sites don't even present you whatever you truly have coming into you until you by some means do  you personal code and just about every individual page within your very own site. personally i have more than 100k pages on my web site so you see the issue suitable... right.

# January 3, 2011 8:16 AM

ipad app said:

-----------------------------------------------------------

Wow! what an concept ! What a concept !?! Beautiful !!. Amazing …

# January 8, 2011 7:03 AM

Jameel said:

Hi  i have created dynamic checkbox ,

those controls i add it in one of my panel control.

now i want those checkbox ID and text in my button click event..

My Code is Here

—————–

private SortedList AcessingDynamicControls()

{

SortedList sList = new SortedList();

dTable=new DataTable();

dTable.Clear();

dTable = MPostOfProperty.ReturnAmenitiesDetail(“Select detail_id from CB_VIEW_Amenities”);

for (int i = 0; i < dTable.Rows.Count; i++)

{

string ID;

bool status;

//CheckBox box = new CheckBox();

//box = this.FindControl(dTable.Rows[i]["id"].ToString()) as CheckBox;

//ID = box.UniqueID;

//status = box.Checked;

CheckBox chk = (CheckBox)PanelAmenities.FindControl(dTable.Rows[i]["detail_id"].ToString());

string s = dTable.Rows[i]["detail_id"].ToString();

ID = chk.UniqueID;

status = chk.Checked;

sList.Add(ID, status.ToString());

}

return sList;

}

————————-

ID = chk.UniqueID;

status = chk.Checked;

————————-

when this code executed an exception generates.Object refrence not set to an instance.I think this is the pblm of postback.Please Help me Today.and Email me to the correct Code.

# March 8, 2011 6:21 AM

Sheikh said:

re: How to set values of dynamically created TextBoxes

# March 14, 2011 6:27 AM

Praveen said:

How to set values for dynamically created textboxes

# April 9, 2011 5:11 AM

Ercan said:

Hey I found the solution !

for(int i=0;i<10;i++) {

     TextBox objBox = new TextBox();

     objBox.ID = "objBox" + i.ToString();

     this.Page.Controls.Add(objBox);

  }

codes must be written in

protected void Page_Init(object sender, EventArgs e)

!!!!

and u are done !

for more questions

konsekarashooto@hotmail.com

# May 5, 2011 6:41 AM

Tanmoy said:

Thanks a lot xxxkarsan.....

# May 6, 2011 3:27 PM

Stephanie said:

Thanks so much. this was exactly what I needed!

# September 16, 2011 12:20 AM

tbehruz said:

no no no 100 .. no it's not working ((((((((

# November 29, 2011 11:35 PM

Adam said:

protected void Page_Load(object sender, EventArgs e)

   {

       doDynamic(); //dynamic controls work at page_load event, are recreated every post

   }

   private void doDynamic()

   {

       for (int i = 1; i <= 3; i++) //replace 3 with your method of counting your controls

       {

           TextBox txt = new TextBox();

           txt.ID = "txt" + i; //unique names

           form1.Controls.Add(txt); //always remember to add them! oh fun wondering what went wrong if you forgot.

       }

       Button btn = new Button(); //let's show off a dynamic button while we're at it

       btn.ID = "btnPush";

       btn.Text = "Dynamic";

       btn.Click += new EventHandler(btn_Click);

       form1.Controls.Add(btn);

   }

   protected void btn_Click(object sender, EventArgs e)

   {

       form1.Controls.Add(new LiteralControl("<br />"));

       for (int i = 1; i <= 3; i++) //same counter to get the controls back

       {

           TextBox txt = (TextBox)form1.FindControl("txt" + i); //got it!

           Label lbl = new Label();

           lbl.ID = "lbl" + i;

           lbl.Text = "Found dynamic control " + txt.ID + "with text: " + txt.Text + "<br />";

           form1.Controls.Add(lbl); //show that you got it.

       }

   }

This is an entire, simple program that works for me.

# December 28, 2011 4:55 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)