smfmetro10
asked on
how do you have a default value of a hidden input based on a url?
Hi,
I have a function that works great, but I need to add the ability of making a hidden input have a value of "6">
The name of the id of the input is" recipientId" and here is the function.
Thanks for the help!
Would it be somewhere that "lhash="#div6" is?
I have a function that works great, but I need to add the ability of making a hidden input have a value of "6">
The name of the id of the input is" recipientId" and here is the function.
Thanks for the help!
<script>
$(document).ready(function() {
$('.label_copy').hide();
lhash=location.hash
if(location.hash==""){
$("#GenInfo").addClass("active");
}
if(lhash==""){
lhash="#div6"
}
$("a[href='"+lhash+"']").closest("div").addClass("active");
$(lhash).show();
$('.show').click(function () {
$('.label_copy').hide();
$('#div' + $(this).attr('target')).show();
});
$('.hide').click(function () {
$('.label_copy').hide();
});
});
</script>
Would it be somewhere that "lhash="#div6" is?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You!!
Out of curiosity why doesn't $("#recipientId") = "6" work?
Out of curiosity why doesn't $("#recipientId") = "6" work?
That's not how jquery works.
$("#recipientId") is an object, you have to specify what you want to change which in this case is the value
$("#recipientId") is an object, you have to specify what you want to change which in this case is the value
ASKER
Ah! Thanks!
<input type="hidden" name="yourHTMLControlName"