Please help forms

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.

On Nov 14, 9:39 am, Smarty 2k [email protected]
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

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

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

    Not get values in second div

    please help me…

    or

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

    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