Skip to main content

Bug Tracker

Side navigation

#7941 closed bug (worksforme)

Opened January 10, 2011 07:04PM UTC

Closed January 11, 2011 01:51PM UTC

Last modified March 13, 2012 03:37PM UTC

setting .val('') for an input type="hidden" makes it inaccessible in future calls.

Reported by: dwhalen@enr-corp.com Owned by:
Priority: undecided Milestone: 1.next
Component: attributes Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

If I set the value of an input type="hidden" using $("#id").val('') then future attempts to set val() fail.

This is verified by using FireBug/FireFox v3.6.

Steps to reproduce:

1) create a simple form with an input type="hidden" in it.

2) using the jQuery selector by id, set the hidden field's value using .val('')

3) at any later time try to set the hidden field's value using .val('anything'). The value will not be seen in firebug, and a call to .val() returns ''.

Attachments (0)
Change History (5)

Changed January 10, 2011 07:07PM UTC by anonymous comment:1

note that the html editor removed the ticks in the parens for val().

it should have been seen like so:

$('#id').val('')

Changed January 10, 2011 07:48PM UTC by rwaldron comment:2

component: unfiledattributes
owner: → dwhalen@enr-corp.com
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced jsFiddle test case to help us assess your ticket!

Additionally, test against the latest jQuery release and the jQuery 0 GIT version to ensure the issue still exists. Be Excellent to eachother!

Changed January 11, 2011 01:49PM UTC by jitter comment:3

owner: dwhalen@enr-corp.com
status: pendingnew

Changed January 11, 2011 01:51PM UTC by jitter comment:4

resolution: → worksforme
status: newclosed

I made a live test case following the description in the report but couldn't verify the described behavior (tested with FF 3.6.13)

Changed January 11, 2011 07:47PM UTC by dwhalen@enr-corp.com comment:5

I apologize. I have a specific page where this happens consistently but I can't share it with the public domain. When I try to create a simple page for demonstrating the issue it doesn't show the behavior. Very frustrating.

If I can build a proper test case I'll request a re-open on this ticket.