Click to See Complete Forum and Search --> : Accessing a form with no name
kelemvor
03-12-2003, 10:09 PM
I have a form that for some unkown reason is having the name=... part removed when the form gets published to the server.
Since we haven't yet figured out why, I need to know the syntax for accesing a form with no name. I thought I could do something like document.form[0].fieldname.value or something but that didn't seem to work.
Or, if I create a link off a form field using an onChange or something like that and I do it in the onChange="Check(this)", what does 'this' get assigned exactly? Does it get assigned the actual field itself so I could just do this.value instead of the whole long doc.form.field.value?
Thanks for any info. *mutter* Stupid FrontPage *mutter*
khaki
03-12-2003, 10:24 PM
You want a work-around for something that should not be a problem?
Forms are identifed by names. (did you try using ID's maybe?)
Can you please post the offending code.
I'm highly skeptical that the form itself is the issue.
Thanks
k
kelemvor
03-12-2003, 10:28 PM
Here's the way the <form> statement looks after FrontPage publishes it.
<form METHOD="POST" action="submission_form.asp" onsubmit="return Validate(this)" language="JavaScript" webbot-action="--WEBBOT-SELF--">
Prior to it being published, it DOES have a Name=line in there but FP removes it for some unknown (so far) reason. So until we figure that out I'm wondering if there's some other way to access the form so I can do standard javascript on fields.
Nedals
03-12-2003, 10:29 PM
You are almost right.
Change form[0] to forms[0]
kelemvor
03-12-2003, 10:31 PM
Bah, I knew it was something like that. Forgot the darn S. I'll give it a shot.
Thanks.
khaki
03-12-2003, 10:37 PM
and yet the form either has no name assigned to it, or you would rather show the after than the before.
Please post the script which contains the unpublished form.
nedals is attempting to give you the work-around solution (which is fine), but your real problem
appears to be that the form name is not being recieved at the server (wouldn't you rather solve that issue?).
Or, better IMO, is this: document.formname.fieldname.value. The reason I say that this is better is because if you start with one form on your page, and decide later to add another, above the first, your new form will be the one returning forms[0] and your original form will be forms[1]. Make sense?
kelemvor
03-12-2003, 10:39 PM
THAT issue is related to FrontPage and I'm working on that with the FP people already.
And since I onlt have one form on the page, I'm fine using forms[0] since there's no way anythign is going to get confused anyway.
Thanks for all the help all.
khaki
03-12-2003, 10:48 PM
Am I out of my mind, or has the internet suddenly decided to begin ignoring form names
so that we must now search for work-arounds for handling them?
If FrontPage is the problem, it's a FrontPage issue (not a form issue).
So... post your code and I'll try it on InterDev.
Or do you not really want help with this?
C'mon kelemvor, your being difficult.
k
FrontPage seems to be more trouble than it is worth...You may want to pick up a good copy of notepad ;) and start coding that way... :p Or, better, find program that has syntax hightlighting. I personally use Dreamweaver, and love it.
kelemvor
03-12-2003, 10:51 PM
No I'm working with one of the FP MVP people in the newsgroups. This started because I don't want to use FP's validation and want to do my own. But FP puts in it's own so I had to go through and delete it out. After I did that, it started getting messy and removing the form name for some reason.
However, I found out that if I used the form name that FP had in there in the first place, then FP would remove it. But if I gave the form a different name, then FP would leave it alone.
Don't know why FP did that but I just changed the name as a test and then FP left it alone.
So, for now I'm good to go.
And Pyro, the only reason I'm using FP on this page is beacuse it hooks up to a database in ASP and I don't know anything about ASP so FP set up the form to input the data into the database and I'm hand coding the rest.
OK, this is my opinion: if you have FrontPage or Dreamweaver you're just plain lucky. All I use for all of my Javascripting and HTML pages and CSS and whatever I make, I use Notepad for. The problem is a lot of times I'll have 400+ lines of code to go through, and when I get an "unspecified error" on line 287 or something, it gets frustrating counting down 287 lines, plus sometimes I get distracted and have to start over...
Luckily I found something that helped... I use a Perl editting program. I can't debug Javascript or HTML or anything, but at least I can see what line I'm on and I can find/replace rather than just find something.
Just my two bits...
kelemvor
03-12-2003, 10:56 PM
The statusbar in notepad has a line counter on it....
Jona, do yourself a favor and view this thread. http://forums.webdeveloper.com/showthread.php?s=&threadid=5708 It has a link to download 1st Page 2000... Much nicer than notepad... ;)
I've use 1st Page 2000, HTMLPad, and many many others. I just don't like the way they're set up. I've used about 7 different JavaScript/HTML/text edittors and I didn't like any of them. I don't really want FrontPage. I think Dreamweaver would be a neat program to use, though. Have you ever used Macromedia Fireworks? How good is it? I'm saving up for Adobe Photoshop.
The statusbar in notepad has a line counter on it....
Um, Notepad has a status bar? Hmm, that's odd, mine doesn't...
kelemvor
03-12-2003, 11:03 PM
Well I'm using XP and mine does. I had to turn it on under VIEW, but it's there. Not sure if it's in earlier versions or not.
Yes, I've used Fireworks. It is quite good with vectors, which is very nice. I use that (Fireworks) and Paint Shop Pro for most of my graphic design.
Until you get Photoshop (or, maybe instead) check out the open source alternative. http://www.gimp.org
http://freewarefind.com/ has an archive of free programs available for download, and it has many many types of text editors. I think that one of the best text editors is WordEdit. My C++ programming friend uses it. But, of course, he uses the Microsoft C++/C# compiler which has all of the syntax highlighting and stuff, but he uses WordEdit.
I don't have XP, I only have Me and 98. Oh, and I have an old Windows 3.1, too
khaki
03-12-2003, 11:08 PM
lol... Men... :D
http://forums.webdeveloper.com/showthread.php?s=&threadid=5737
I don't get it, Khaki... Did I do something wrong?
Nedals
03-12-2003, 11:15 PM
Jona,
Pick up a copy of Homesite (maybe next birthday). It's easy to use and doesn't mess with your code. You can easily flip back and forth between code view and website view. It has a basic validor included and I don't believe it's that expensive.
khaki is in a really fiesy mood tonight! :D
Pick up Homesite (maybe next birthday)
My next birthday is the 31st of the month! Are you sure you don't know how much it costs?
khaki is in a really fiesy mood tonight! :D
She's cool. Fiesty mood? No, she's just that way. I don't mind it, really. As long as I don't get on her "bad side" ... ;)
kelemvor
03-12-2003, 11:24 PM
[QUOTE]Originally posted by Jona
[B]My next birthday is the 31st of the month! Are you sure you don't know how much it costs?
http://www.macromedia.com/software/homesite/
There's a free demo link on there somewhere...
Wow! I didn't know Dreamweaver was so expensive!
khaki
03-12-2003, 11:33 PM
Wow! I didn't know Dreamweaver was so expensive! ...and it doesn't even say Microsoft on the box!
Wow... another corporate giant getting rich off the backs of others.
Amazing!
khaki
03-13-2003, 09:16 AM
kelemvor wrote: The statusbar in notepad has a line counter on it....I'm not going to say your wrong kelemvor, but my version of Notepad
(version 5.0, build 2195: service pack 2) doesn't even have a statusbar.
Now I understand that your version of FrontPage is different from any
other version than I ever heard of (lol), but what version of Notepad
do you have? (seriously!)
and Jona... Notepad is hard-core. It makes a real programmer out of you.
But I understand your frustration at not having the basic development tools,
so I'll look for where I put the disc(s?) for Dreamweaver / UltrDev4 (not MX)
and I will send it to you for your b'day.
I don't use it (it's not my thing. I'm a Microsoft girl ;) ).
(although I do use Fireworks... it seems to fit my style. wink)
I've got to find it though (no small task... believe me), so just PM me with your
address and I'll send it when I find it.
You definitely deserve it... Of all the people who don't seem to understand me...
you don't seem to understand me the best! lol
k
kelemvor
03-13-2003, 09:21 AM
My Help About screen says...
Microsoft Notepad
Version 5.1 (Build 2600.xpsp1.020828-1920 : Service Pack1)
And under the View menu I have a Status Bar which has the Line and Column number on the bottom right.
khaki
03-13-2003, 09:34 AM
Really!
That's excellent.
(see that Microsoft haters... they haven't stopped tweaking away
at even the basic stuff).
Well, all I know is that apparently the "Dell Dude" sold me a bunch
of outdated crap! (lol. I can't stand that guy).
So anyway, is your form issue resolved now (for real)?
learning to survive with antiquated Notepad software...
k