# Please help forms

**URL:** <https://www.ruby-forum.com/t/please-help-forms/153281>\
**Category:** Rails\
**Created:** [November 14, 2008, 10:39am UTC](https://www.ruby-forum.com/t/please-help-forms/153281 "2008-11-14T10:39:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![smartee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@smartee](https://www.ruby-forum.com/u/smartee)\
**Post date:** [November 14, 2008, 10:39am UTC](https://www.ruby-forum.com/t/please-help-forms/153281/1 "2008-11-14T10:39:15Z")

</div>

Hi friends,

please help me…

my template is:  
view.rhtml

My controller is…

def create  
@firstname=params[:empfirstname]  
@lastname=params[:emplastname]  
@contacts = Contactbook.get :firstname =\> @firstname, :lastname =\>  
@lastname  
end

Enter

 this div only working

But… Second

 not working

Get only first div datas only…  
please help me…

Thanks.

---

<div class="post-metadata">

**Author:** ![smartee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@smartee](https://www.ruby-forum.com/u/smartee)\
**Post date:** [November 14, 2008, 10:43am UTC](https://www.ruby-forum.com/t/please-help-forms/153281/2 "2008-11-14T10:43:23Z")

</div>

On Nov 14, 9:39 am, Smarty 2k [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Enter
> 
> this div only working
> 
> But… Second
> 
> not working
> 
> Get only first div datas only…  
> please help me…

That’s what rails does if two inputs have the same name: it only uses  
the first one (unless the name ends with [], in which case you’ll get  
an array with all the values).

Fred

---

<div class="post-metadata">

**Author:** ![smartee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@smartee](https://www.ruby-forum.com/u/smartee)\
**Post date:** [November 14, 2008, 10:51am UTC](https://www.ruby-forum.com/t/please-help-forms/153281/3 "2008-11-14T10:51:10Z")

</div>

function switchEmailLogin(vendor) {  
if(vendor==“first”) {  
document.getElementById(‘second’).style.display = “none”;  
document.getElementById(‘first’).style.display = “”;  
}  
else if(vendor==“second”) {  
document.getElementById(‘first’).style.display = “none”;  
document.getElementById(‘second’).style.display = “”;  
}  
}  
same else4  
error…

undefined method `downcase’ for [“aaaaa”, “aaaa”, “”]:Array

That’s what rails does if two inputs have the same name: it only uses  
the first one (unless the name ends with [], in which case you’ll get  
an array with all the values).

Fred

---

<div class="post-metadata">

**Author:** ![smartee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@smartee](https://www.ruby-forum.com/u/smartee)\
**Post date:** [November 14, 2008, 11:13am UTC](https://www.ruby-forum.com/t/please-help-forms/153281/4 "2008-11-14T11:13:27Z")

</div>

please help me…

my template is:  
view.rhtml

- ![]( "First")
- ![]( "Second")

My controller is…

def create  
@firstname=params[:empfirstname]  
@lastname=params[:emplastname]  
@contacts = Contactbook.get :firstname =\> @firstname, :lastname =\>  
@lastname  
end

Enter

 this div only working

But… Second

 not working

Not get values in second div

please help me…

or

Through Error undefined method `downcase' for ["aaaaa", "aaaa", ""]:Array

---

<div class="post-metadata">

**Author:** ![smartee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@smartee](https://www.ruby-forum.com/u/smartee)\
**Post date:** [November 14, 2008, 11:53am UTC](https://www.ruby-forum.com/t/please-help-forms/153281/5 "2008-11-14T11:53:50Z")

</div>

On 14 Nov 2008, at 10:13, Smarty 2k wrote:

> Through Error undefined method `downcase’ for [“aaaaa”, “aaaa”,  
> “”]:Array

If you do this then params[:empfirstname] will be an array so you need  
to handle it appropriately. I have no idea what you are doing but it  
may be more appropriate to just disabled the inputs when you hide  
their containing div.

Fred
