---
title: "multiple textboxes for one field"  
description: "multiple textboxes for one field"  
author: "Anonymous User"  
published: 2014-01-31  
updated: 2014-01-31  
canonical: https://www.mindstick.com/forum/1931/multiple-textboxes-for-one-field  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 1 minute  

---

# multiple textboxes for one field

If I have 3 [text boxes](https://www.mindstick.com/forum/34261/how-to-split-data-to-text-boxes-when-read-qr-code-data) for 3 [field](https://www.mindstick.com/forum/160867/does-mindstick-provide-training-for-field-marketing) which need to be appended [together](https://yourviews.mindstick.com/view/80819/live-in-relationship-protecting-the-right-to-live-together), how would you go about doing this?

for example:

@[Html.TextBoxFor](https://www.mindstick.com/forum/33953/what-is-the-difference-between-html-textbox-vs-html-textboxfor)([model](https://yourviews.mindstick.com/view/81334/america-is-reopening-after-corona-lockdown-but-on-swedish-model) => model.PhoneNumber, new { @id = "PhoneNumber1"})

@Html.TextBoxFor(model => model.PhoneNumber, new { @id = "PhoneNumber2"})

@Html.TextBoxFor(model => model.PhoneNumber, new { @id = "PhoneNumber3"})

but when I call model.PhoneNumber in the [controller](https://www.mindstick.com/blog/273/passing-values-from-controller-to-view-in-asp-dot-net-mvc), I only get the first text box value.

## Replies

### Reply by Pravesh Singh

Hi Goti,\

You would need multiple phone numbers in your model phoneNumber1, phoneNumber2, phoneNumber3 as you can only bind one element of one type to the model.

Alternatively you can use FormCollection

use standard imports instead of model binding

```
<input type="text" value="" name="phoneNumber" id="phoneNumber1" /><input type="text" value="" name="phoneNumber" id="phoneNumber2" /><input type="text" value="" name="phoneNumber" id="phoneNumber3" />Then in your Controller[HttpPost]public ActionResult Index(MyModel model, FormCollection frm){//get elements from formString[] numbers = frm["phoneNumber"].Split(',');// you will have your 3 numbers}
```


---

Original Source: https://www.mindstick.com/forum/1931/multiple-textboxes-for-one-field

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
