Advertisement:

Author Topic: Require Dollar amount in custom field  (Read 831 times)

shizzba

  • Newbie
  • *
  • Posts: 33
Require Dollar amount in custom field
« on: February 14, 2014, 08:15:38 am »
Hi,
I was wondering how i could require a price in a custom field instead of text.  In my site, shizzbaDOTcom, i want to put different amounts for different rental periods.  ie hourly, monthly, etc.  Right now i use a text field but i would like for it to be a little more standardized if possible.  If this is too complicated for a newb, please suggest a good developer?
Thanks

aide2001

  • Guest
Re: Require Dollar amount in custom field
« Reply #1 on: February 14, 2014, 11:04:00 am »
Please can you be more specific, Like in your custom fields, can you not just do
1. $ week = 100
2. $ month = 200
etc and just put the dollar sign in your custom field.??

shizzba

  • Newbie
  • *
  • Posts: 33
Re: Require Dollar amount in custom field
« Reply #2 on: February 15, 2014, 09:42:40 am »
@aide2001 - I have seen a couple of other post by you and the thing i love is that you always provide such a simple answer that i always say to myself "duh".

I was thinking of something more complex like using the code that is used in the price field and modifying the custom fields with the same code but I didnt know where custom fields were in the code.  This would make it so that only numbers (no text) would be allowed.

I will use your method for now until i understand the code good enough to modify it.

Thank you very much for replying.


aide2001

  • Guest
Re: Require Dollar amount in custom field
« Reply #3 on: February 16, 2014, 08:39:51 pm »
custom fields are in your admin side of things, best not go there, but what you could do, if you know any database stuff, is find the custom field in your DB and change that particular part to only accept numbers

shizzba

  • Newbie
  • *
  • Posts: 33
Re: Require Dollar amount in custom field
« Reply #4 on: February 16, 2014, 11:54:46 pm »
Aide2001 -

Thanks again.  I am using your first method and it is working really good and easy.  I am comfortable doing basic edits in a DB table but the thing i dont understand is how to change it to require a number when the only choices in my DB table are the same as the ones in my admin area.  I would assume that to add a new choice to that drop down menu that i would have to find the drop down menu and alter it?

I attached a picture of what i mean.

Thanks!

aide2001

  • Guest
Re: Require Dollar amount in custom field
« Reply #5 on: February 17, 2014, 01:28:10 pm »
If this is the only custom field, you could try changing the column that's named s_name   Its type from varchar (255) to something like numbers only and given it a say 6 or 7 digit only, im not the greatest on mysql or databases, so if the 1st option works, leave it alone.
If it aint broke, dont try n fix it  ;)