Closed Thread Icon

Preserved Topic: Form breaks when another form is added Pages that link to <a href="https://ozoneasylum.com/backlink?for=18472" title="Pages that link to Preserved Topic: Form breaks when another form is added" rel="nofollow" >Preserved Topic: Form breaks when another form is added\

 
Author Thread
Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 02-23-2002 03:39

I have a very simple form:
<form name="starlogo">
<select name="item_size">
<option value="">Pick</option>
<option value="Large">Large</option>
<option value="X-Large">X-Large</option>
<option value="XX-Large">XX-Large</option>
</select>
<input type="button" value="Add to cart" onclick="add2cart('T-Shirt: Sheriff Star logo on left chest',starlogo.item_size.value,'12.00')"
</form>


It works fine.

I add another form underneath that one:

<form name="jail">
<select name="item_size">
<option value="">Pick</option>
<option value="Large">Large</option>
<option value="X-Large">X-Large</option>
<option value="XX-Large">XX-Large</option>
</select>
<input type="button" value="Add to cart" onclick="add2cart('T-Shirt: Property of Macomb County Jail on front',jail.item_size.value,'12.00')"
</form>


As soon as I add this, the first form stops working (onclick does nothing), and this second form alerts with "jail is undefined". Yet if I remove the first form from the page, this form works great.

Obviously, I have something out of whack. I tried changing the onclick line on the second one to <input type="button" value="Add to cart" onclick="add2cart('T-Shirt: Property of Macomb County Jail on front',jail.item_size.options[selectedIndex].value,'12.00')" but that didn't work either. What am I missing (other than some working brain cells)?

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 02-23-2002 04:36

Well, although I vaguely remember IE letting you leave it out, you're supposed to say "document.starlogo.item_size.value" and "document.jail.item_size.value"; the key part here is "document.". Give that a shot and see if it works.

[oh, btw, check your email, will you? =) ]

[This message has been edited by Slime (edited 02-23-2002).]

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 02-23-2002 04:44

No, that didn't work. In fact, I had tried that as well....

The code is at Shopping cart

Mail checked....

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 02-23-2002 04:55

Oh, I don't think you're ending your button tags. There's no ">" at the end of them.

Thanks for checking your email - remember, you forget the money and we're screwed... Don't tell anyone about this, either.

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 02-23-2002 04:56

Yeah, I was just fixing the input tags....I swear I'm losing my mind....

I won't tell anyone about the money....what's my code name again? Snowman or Falcon?

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 02-23-2002 05:11

Yours is "buttercup fairy."

« BackwardsOnwards »

Show Forum Drop Down Menu