Jump to content


Photo

What does this line mean??


  • Please log in to reply
3 replies to this topic

#1 kenwvs

kenwvs
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts

Posted 15 July 2006 - 03:34 PM

The following is part of a file and I am wondering what the form.sb_buynow_price.value! means.  Is it referincing to another file, or is that a command to make something work?

It is a buy now feature in an auction program and the buy now was working, and I paid someone to do some upgrades, and now the buy now feature appears when listing an item, but doesn't appear to th buyer to make a purchase. 

I am thinking the stuff lower down that is referenced out (*/) is because I didn't want paypal to be a condition, but an option, so it was changed.

Thanks,

Ken

if(form.sb_buynow_price.value!='')
                {
                        if(isNaN(form.sb_buynow_price.value) || form.sb_buynow_price.value <= 0 )
                        {
                                alert("Please specify positive nonzero value for Buy Now Price");
                                form.sb_buynow_price.focus();
                                return false;
                        }
                /*        if( form.paypal_id.value=='')                ------disabled
                        {
                                alert("You must specify Paypal Id for buy now option to work");
                                form.paypal_id.focus();
                                return false;
                        }
                        if (!emailCheck (form.paypal_id.value) )
                        {
                                form.paypal_id.focus();
                                return (false);
                        }*/
                }

#2 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 15 July 2006 - 03:36 PM

Looks like something to do with javascript to me. Either that or something with Flash, but I'm assuming against the latter.

Technically they could be constants, but as a rule you capitalize those--and using constants makes no sense in this case.

I'm stumped.

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!


#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 15 July 2006 - 04:11 PM

This code has nothing to do with PHP. The code you are refering to is javascript and not php. I am moving this to the javascript forum

#4 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 15 July 2006 - 04:41 PM

It checks to make sure that the value is not empty, it's not a number, and it's greater than zero.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users