Topic: Updating text on Submit Button

Hello ya'll!

I'm sorry I don't have my code to show you.  I'm in a real wierd place where the internet is slim to none and I have to use their machines.

Currently I have a "store" app that, as users add items to their cart they get stored into a line_items table.  I currently have a piece of code that checks if that item_id is already in the line_items table with the correct customer_id.  What I want to do now is, instead of in a usual store where the iterms will be incremented.  In my case, I just need the value to be updated/changed when input into the quantity field.  (I already have this working.)

But where I need help is writing a small piece of code that checks the if there is anything in the line_items with that equipment_id and customer_id (or simply make the previous code a method) and then change the submit tag next to the item from "Add to Cart" to "Update Quantity".  I've been toying around with it and I think I might have possibly found something that works but I'm still scrapping away at it for a couple of days now.  I could really use some your help.

I really appreciate any help you can all give me.

Kyle Daigle
Newb' Ruby on Rails Programmer

Re: Updating text on Submit Button

Do you need to update the button through Javascript/AJAX? Or are you doing this on a new page request?

Railscasts - Free Ruby on Rails Screencasts