1 Replies - 376 Views - Last Post: 14 September 2012 - 10:23 AM

#1 ray1234  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 148
  • Joined: 07-September 12

return statements after declaring a function for an event

Posted 14 September 2012 - 09:53 AM


<form id="form1" onsubmit="movebox() [b]return false[/b]" />





what does return false actually do? and what actually happens when this is excuted?

ray
Is This A Good Question/Topic? 0
  • +

Replies To: return statements after declaring a function for an event

#2 StefanOnRails  Icon User is offline

  • D.I.C Head

Reputation: 35
  • View blog
  • Posts: 106
  • Joined: 31-July 12

Re: return statements after declaring a function for an event

Posted 14 September 2012 - 10:23 AM

Firstly, I think you need a semicolon ( ; ) after calling that movebox() function. Secondly, return false is used to prevent data to be submited and cause a page refresh.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1