On 1/4/07, Karl Swedberg [EMAIL PROTECTED] wrote:
I should have mentioned that I changed the HTML as well. I added an ID to
the submit button (submit-member). Notice how the event is being triggered
now: $('#submit-member').click(function() {...});
yes, I have that, and the event is happening
and yes, I've gone over to using a button type, and will likely cut
out the form tags too. thanks for that suggestion Doug.
--
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131
OK, I've fixed it. I also had a table which was used to align elements
which I had omitted for clarity. I looked up prev(), and saw that it
looks for the unique previous element ... removed the table and all
is OK.
My code us now this:
(in myapp.js )
$(document).ready(function() {
Doug Tabacco schrieb:
True, but if it's not meant to be submittable, you could always just
remove the form tags as well.
I always think of graceful degradation when building scripts/pages. With
JavaScript off any form is submittable, no matter if it is meant to be
or not.
From the initial
Hi
Just getting into using js to do things. I'm just experimenting right now.
Here is my example code:
p id=member_info/p
script type=text/javascript
function findMember(form){
$(#member_info).html(form.username.value);
}
/script
form name=find_member action= method=GET
input
now what happens when I fill in a value and click is that the value I
entered into the text box appears in the member_info p ... but
disappears again almost straight away.
Try: onclick=findMember(this.form); return false;...
Without the return false in there you're going to submit the form.
I think the form may be submitting. The whole page is reloading when you
click submit. Try onClick=findMember(this.form; return false;.
Blair
On 1/4/07, Daniel McBrearty [EMAIL PROTECTED] wrote:
Hi
Just getting into using js to do things. I'm just experimenting right now.
Here is my example
it's a form.. it's submitting. you get a new page... it's gone! if you
target the form into an iframe you might get your desired results.
On 1/3/07, Daniel McBrearty [EMAIL PROTECTED] wrote:
Hi
Just getting into using js to do things. I'm just experimenting right now.
Here is my example
Daniel McBrearty schrieb:
Hi
Just getting into using js to do things. I'm just experimenting right now.
Here is my example code:
p id=member_info/p
script type=text/javascript
function findMember(form){
$(#member_info).html(form.username.value);
}
/script
form
Mike Alsup schrieb:
now what happens when I fill in a value and click is that the value I
entered into the text box appears in the member_info p ... but
disappears again almost straight away.
Try: onclick=findMember(this.form); return false;...
Without the return false in there you're
Okay, so Mike and Blair got back to you before I could, but I'm going
to answer anyway.
They're right, of course, that you need to return false, because you
want to stop the default action.
One of the great things about jQuery is that it lets you easily
separate behavior from content. So
Karl Swedberg schrieb:
Okay, so Mike and Blair got back to you before I could, but I'm going to
answer anyway.
They're right, of course, that you need to return false, because you
want to stop the default action.
One of the great things about jQuery is that it lets you easily separate
thanks a lot guys. That 's really a great response.
I got it to basically work, now I'll read through your suggestions and
clean it up. I'm still learning ... :-)
thanks again.
Daniel
On 1/4/07, Karl Swedberg [EMAIL PROTECTED] wrote:
Okay, so Mike and Blair got back to you before I could, but
On Jan 3, 2007, at 8:05 PM, Klaus Hartl wrote:
All your solutions don't take into account that IE6 will still submit
the form if you hit enter - that was discussed a while back and here's
the test page for this:
http://stilbuero.de/demo/jquery/submit_test.html
-- Klaus
Good point, Klaus. I
All your solutions don't take into account that IE6 will still submit
the form if you hit enter
Good catch, Klaus. As usual!
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
As several others have pointed out, the problem is that the form is
submitting. If that's not what you eventually want to happen, why not
just make the submit input into a button input (type=button)?
Daniel McBrearty wrote:
Hi
Just getting into using js to do things. I'm just experimenting
Doug Tabacco schrieb:
As several others have pointed out, the problem is that the form is
submitting. If that's not what you eventually want to happen, why not
just make the submit input into a button input (type=button)?
I'm sure you will still be able to submit the form by hitting
html
head
script src=scripts/jquery.js
type=text/javascript/script
script type=text/javascript charset=utf-8
$(document).ready(function() {
$('#submit-member').click(function() {
var username = $(this).prev().val();
$(#member_info).html(username);
return false;
});
True, but if it's not meant to be submittable, you could always just
remove the form tags as well.
Klaus Hartl wrote:
Doug Tabacco schrieb:
As several others have pointed out, the problem is that the form is
submitting. If that's not what you eventually want to happen, why not
just make
I should have mentioned that I changed the HTML as well. I added an
ID to the submit button (submit-member). Notice how the event is
being triggered now: $('#submit-member').click(function() {...});
Since var username = $(this).prev().val() is appearing inside the
click method, $(this)
20 matches
Mail list logo