On 05/03/07, James Thomas [EMAIL PROTECTED] wrote:
Close ... try this:
$(a).click(function(){return alertSave($(this).attr(href));});
function alertSave(url) {
var dataControl = $('#changedAppointments').attr(value);
if (dataControl.length 0) {
if
That's true - I didn't change it because I thought there could be some cases
where alertSave() could be called outside of the 'a' thing - if that's not
the case, then this version is definitely better. You could go so far as to
eliminate the variable as well and just do:
if
You need to return false if you don't want something to happen. so if
(confirm('whatever')) { do_whatever(); } else return false;
smeranda wrote:
When a user clicks a link and a form field currently has data, a
confirmation box appears. This is close to working, but if a user clicks
Still no luck, this is what I have:
$(a).click(function(){alertSave($(this).attr(href));});
function alertSave(url) {
var dataControl = $('#changedAppointments').attr(value);
if (dataControl.length 0) {
if (confirm(You have made changes to this date which have
On Monday 05 March 2007 13:56, smeranda wrote:
Still no luck, this is what I have:
$(a).click(function(){alertSave($(this).attr(href));});
function alertSave(url) {
var dataControl = $('#changedAppointments').attr(value);
if (dataControl.length 0) {
if (confirm(You have made changes
That's perfect! Thanks James.
James Thomas wrote:
Close ... try this:
$(a).click(function(){return alertSave($(this).attr(href));});
function alertSave(url) {
var dataControl = $('#changedAppointments').attr(value);
if (dataControl.length 0) {
if