please help me....

my template is:
view.rhtml
<script>
function switchLogin(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 = "";
}
}

</script>
<li><a href="#"><img src="../images/a.gif"  title="First" 
onclick="switchLogin('first');"/></a></li>
<li><a href="#"><img src="../images/b.gif" border="0" title="Second" 
onclick="switchLogin('second');"/></a></li>
<form action="/a/create">
<div id="first">
<div><input type="text" name="empfirstname"/></div>
<div><input type="text" name="emplastname"/></div>
</div>
<div id="second">
<div><input type="text" name="empfirstname"/></div>
<div><input type="text" name="emplastname"/></div>
</div>
</form>

My controller is....

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

Enter <div id="first"> this div only working

But.... Second <div id="first"> not working

Not get values in second div

please help me.....

or

<form action="/a/create">
<div id="first">
<div><input type="text" name="empfirstname[]"/></div>
<div><input type="text" name="emplastname[]"/></div>
</div>
<div id="second">
<div><input type="text" name="empfirstname[]"/></div>
<div><input type="text" name="emplastname[]"/></div>
</div>
</form>
Through Error undefined method `downcase' for ["aaaaa", "aaaa", 
""]:Array
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to