[jQuery] Re: edit an onclick attribute to create a php query string

2008-11-20 Thread ricardobeat

It is opening a new tab because it is executing the default action.
href="" equals the current URL, so it's opening that in a blank
window. Return false to avoid that.

$("a").click(function(){
parent.location='upload.php?item=2';
return false;
});

On Nov 20, 12:33 pm, edzah <[EMAIL PROTECTED]> wrote:
> Ok I've got this working, dunno if it was a syntax issue or what, but
> I did this:
>
> $("a").click(function() { parent.location='upload.php?item=2' });
>
> Although it behaves slightly strange. It opens the upload.php?item=2
> as a tab in FF, then opens the original page in a new tab and focuses
> on that. My  tag:
>
> upload 
>
> I would still be interested in any comments regarding this method of
> uploading to a mysql dbase...
>
> thanks
>
> On Nov 20, 2:16 pm, edzah <[EMAIL PROTECTED]> wrote:
>
> > Should really do more reading but at the moment I haven't got the time
> > so I would appreciate any help I can get.
>
> > Overview:
>
> > I have a form (with the default submit turned off) that takes user
> > input and adds each form entry into a table below the form. The user
> > will then review the list of entries to be uploaded and then clicks an
> > upload button to upload it to the mysql dbase.
>
> > My problem:
>
> > The button I am using is an anchor tag, with the attribute onclick. I
> > want to take all the entries in the table and then create a php query
> > string so that when the anchor tag is click it will pass this data to
> > a php file which will do the mysql insert.
>
> >  > target="_blank">upload
>
> > But I cannot seem to access/update the onlick attribute.
> > I hoped this would work:
>
> > $("a").attr({ onclick : "parent.location='upload.php?item=2'" });


[jQuery] Re: edit an onclick attribute to create a php query string

2008-11-20 Thread edzah

Ok I've got this working, dunno if it was a syntax issue or what, but
I did this:

$("a").click(function() { parent.location='upload.php?item=2'   });

Although it behaves slightly strange. It opens the upload.php?item=2
as a tab in FF, then opens the original page in a new tab and focuses
on that. My  tag:

upload 

I would still be interested in any comments regarding this method of
uploading to a mysql dbase...

thanks

On Nov 20, 2:16 pm, edzah <[EMAIL PROTECTED]> wrote:
> Should really do more reading but at the moment I haven't got the time
> so I would appreciate any help I can get.
>
> Overview:
>
> I have a form (with the default submit turned off) that takes user
> input and adds each form entry into a table below the form. The user
> will then review the list of entries to be uploaded and then clicks an
> upload button to upload it to the mysql dbase.
>
> My problem:
>
> The button I am using is an anchor tag, with the attribute onclick. I
> want to take all the entries in the table and then create a php query
> string so that when the anchor tag is click it will pass this data to
> a php file which will do the mysql insert.
>
>  target="_blank">upload
>
> But I cannot seem to access/update the onlick attribute.
> I hoped this would work:
>
> $("a").attr({ onclick : "parent.location='upload.php?item=2'" });


[jQuery] Re: edit an onclick attribute to create a php query string

2008-11-20 Thread edzah

Ok I've got this working, dunno if it was a syntax issue or what, but
I did this:

$("a").click(function() { parent.location='upload.php?item=2'   });

Although it behaves slightly strange. It opens the upload.php?item=2
as a tab in FF, then opens the original page in a new tab and focuses
on that. My  tag:

upload 

I would still be interested in any comments regarding this method of
uploading to a mysql dbase...

thanks

On Nov 20, 2:16 pm, edzah <[EMAIL PROTECTED]> wrote:
> Should really do more reading but at the moment I haven't got the time
> so I would appreciate any help I can get.
>
> Overview:
>
> I have a form (with the default submit turned off) that takes user
> input and adds each form entry into a table below the form. The user
> will then review the list of entries to be uploaded and then clicks an
> upload button to upload it to the mysql dbase.
>
> My problem:
>
> The button I am using is an anchor tag, with the attribute onclick. I
> want to take all the entries in the table and then create a php query
> string so that when the anchor tag is click it will pass this data to
> a php file which will do the mysql insert.
>
>  target="_blank">upload
>
> But I cannot seem to access/update the onlick attribute.
> I hoped this would work:
>
> $("a").attr({ onclick : "parent.location='upload.php?item=2'" });