...

View Full Version : accessing HTML/PHP forms in javascript



heaps21
03-18-2004, 05:33 PM
Right, I have a form that is of the form:


<form name=$name id=$id method=post action=nextpage.php>
|
|
|
<a href=javascript:
</form>


my question is what has to some after the javascript: bit of the href in order to submit this form? Basically I dont know how to access the form name because it is a variable. Can anyone help?
Thanks.

Vladdy
03-18-2004, 05:57 PM
What happened to the
<input type="submit" ....
:confused:

FYI: You do not put javascript is href anyway.

heaps21
03-18-2004, 06:03 PM
I have used <a href="javascript:document.getElementById(...) " before no problem, just not where the form name is a variable. I dont really want a submit button as the page produces a long list so i would prefer links to make the aesthetics nicer really

Garadon
03-18-2004, 06:29 PM
<a href="javascript:this.parentNode.name"


I think should work in your example

Willy Duitt
03-18-2004, 06:38 PM
Originally posted by Garadon
<a href="javascript:this.parentNode.name"


I think should work in your example

I do not agree with using an anchor.
But, if I had to, I would use:
this.form.submit()

Why don't make a text image and use:
<input type="image" src="submitImage.jpg">


.....Willy

Vladdy
03-18-2004, 07:10 PM
What does the element you use have to do with aesthetics :confused:
Have you heard about CSS???

heaps21
03-18-2004, 07:34 PM
Thank you very much Willy, that idea has saved me a lot of worry :D

Willy Duitt
03-18-2004, 07:39 PM
I'm glad you understood what I was trying to say.
Because I just reread my post and that sounded renarted. :p

.....Willy



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum