Click to See Complete Forum and Search --> : Resetting not all form data


downtownjack197
06-20-2003, 06:38 AM
Hello, I am using a tagboard, and i cant seem to figure out what im doing wrong. Id like to clear the fields of the form, but not the tagboard itself (which is apart of the form). Since i am a bit new to forms, i need a little help. Here is the code:

<td align="center"><SCRIPT LANGUAGE="Javascript" TYPE="text/javascript" SRC="http://www.tag-board.com/tagboard.js?boardname=24seven"></SCRIPT>
<table width="200" cellpadding="2" cellspacing="0" border="0">
<tr>
<td width=200 height=200 valign=top>
<iframe src="http://www.tag-board.com/my.tag?name=24seven" name="tag" width="200" height="200"
marginwidth="0" marginheight="0"></iframe>
<script>netscape_support();</script>
</td>
</tr>
<tr>
<td>
<a href="http://www.tag-board.com/" target="_new">Powered by TagBoard Message Board</a>
</td>
</tr>
<tr>
<td>
<form action="http://www.tag-board.com/add.tag" method="post" name="tagform" target="tag">
<input type="hidden" name="name" value="24seven"><font face=tahoma color=#F87302> Name </font><br>
<input name="tagname" maxlength="20" type=text style="background-color:#CC66FF" text-color="000000" border-color=000000><br>
<font face=tahoma color=#F87302>URL or Email</font><br>
<input name="tagurl" maxlength="100" type=text style="background-color:#CC66FF" text-color="000000" border-color=000000><br>
<font face=tahoma color=#F87302>Messages(<a href="http://www.tag-board.com/smilies/smilies.htm" onClick="return pop_up_smilies();" target="_blank">smilies</a>) </font>
<br>
<textarea cols="24" rows="3" name="message" type=text style="background-color:#CC66FF" text-color="000000" border-color=000000 wrap><%%TEXTAREA><br>
<input class=button type="image" src="http://users.igl.net/jack/247tag.gif" border=0>
<input class=button type="image" src="http://users.igl.net/jack/247reset.gif" border=0 onClick="history.go(0)">
</form>
<script>rememberme()</SCRIPT>

downtownjack197
06-20-2003, 07:17 AM
OK Dave, now by doing this Id be able to reset the contents of the 3 fields of text with one click? Or is there a way that i can make this work by taking the tagboard itself out of the form? Your help is most appreciated. :confused:

downtownjack197
06-20-2003, 07:19 AM
Oh and as you can see, i thought maybe putting this in an iframe and having a refresh script would work, but the fields are still filled. Thank you again

downtownjack197
06-21-2003, 06:08 AM
OK Dave, Its either too much caffeine or not enuf sleep that i just dont seem to be getting this thru my thick head.... so if you could help me out here Id really app it. Maybe its just that Im new to Javascript (and forms), more used to HTML, and im prolly missing something as inane as a semicolon, but you being the expert should be able to make me see the folly in what Im doing here.... (btw, I thank you for replying, I was thinking that ppl were skipping over my post because i couldnt seem to use the english language properly
---resetting not all form data?!?--- lol yes i need more sleep)

OK lets break this down a little bit. I have put the code in as you said, but obviously i wasnt too clear on something.... cause the way that Im putting it in its posting the message on the board, but there is no resetting going on ..... *sigh*

var str = document.formName.fieldName.value;
document.formName.reset();
document.formName.fieldName.value = str;


now, the formName is tagform.... got that one.
fieldName.... this is where Im running into some issues. because Id like the tagname, tagurl, and the textarea to reset when i click the reset gif that i made. SO, should I be naming all 3 areas and separating them with commas? Or is what Im trying to do with resetting the text area impossible? Whats happening with the code the way it is below, its still resetting all fields.

and whats with that hidden input/name/value? is that something i should be including as well?

OK, now the value, (like i said i'm new to forms, generally I look for a source code that i can adapt color wise)..... what exactly is the value doing? And what is the value that im looking for here? If there is no value listed for that input do I do away with the value in the code? Im thinking that if there is no value already present, then i leave it blank, but id like clarifcation on this if you would pls.

Do I need to use this same code 3 times in order to make it work? *Tries that before i post message* nope, for some reason that threw off my table that i had the tagboard in.... lol

And how am I to get the textarea to reset as well, seeing as how it doesnt have an <input> flag all its own? Do I have to give the textarea a name? (noticing it doesnt have one) (and out of curiosity, why does the textarea end like it does, with the %%'s?)

In short, I am COMPLETELY lost here and I need professional help (maybe not too far from the truth eh? lol)

I still can't help but thinking this would all be alot easier if there was a way i could remove the tagboard itself as one of the elements of the form, then i could just use the handy reset button.

Yes yes, I am full of q's, but i figure this is the only way you get better at something is practice practice, throwing your comp out the window out of sheer frustration, buying a new comp, and then going to someone more knowledeable then I... I do apologize that some of those q's are venturing on cross-posting with the HTML side, Id just assume work with the same person that I have already dealt with.
(jk about throwing the comp out the window --yet-->

Once again, I appreciate any and all help that I get from you.

Jack

<form action="http://www.tag-board.com/add.tag" method="post" name="tagform" target="tag">
<input type="hidden" name="name" value="24seven"><font face=tahoma color=#F87302>
Name<br>
<input name="tagname" maxlength="20" type=text style="background-color:#CC66FF" text-color="000000" border-color=000000><br>
URL or Email<br>
<input name="tagurl" maxlength="100" type=text style="background-color:#CC66FF" text-color="000000" border-color=000000><br>
Messages(<a href="http://www.tag-board.com/smilies/smilies.htm" onClick="return pop_up_smilies();" target="_blank">smilies</a>)
<br>
<textarea cols="24" rows="3" name="message" wrap type=text style="background-color:#CC66FF" text-color="000000" border-color=000000><%%TEXTAREA><br>
<input class=button type="image" src="http://users.igl.net/jack/247tag.gif" border=0>
<input class=button type="image" src="http://users.igl.net/jack/247reset.gif" border=0 onClick="var str = document.tagform.tagname.24seven; document.tagform.reset(); document.tagform.tagname.24seven = str;">
</form>

www.myleague.com/24_seven/

maybe that will give you a better idea of what im talking about, the tagboard is almost at the bottom of the page...