Hi AliUK-2,
Did you ever get a solution to this? I need to do the same thing and it
seems hard to do in jquery.
I can easily do it in standard js but can't pass the variable to jquery.
<script type="text/javascript">
function checkFormName(obj,formobj) {
formAname=formobj.name
if(obj.checked==true)
{
document.forms[formAname].Purchased.value="yes";
}
else
{
document.forms[formAname].Purchased.value="";
}
}
</script>
<input type="submit" value="Echo as HTML"
onMouseOver="javascript:checkFormName(this.form.id);"/>
Let me know if you found out anything or you can pass the variable above to
Jquery somehow? I have not found a way.
Thanks,
lance
AliUK-2 wrote:
>
>
> Hi,
> is it possible to passed the jQuery object a variable with the the js
> functions for example?
> I'm having problems with jQuery. I have an img that on click it runs
> this function however nothing gets hidden or shown.
>
> I have the following in my page header
>
>
> Code:
> function hide_Show(RegionID)
> var $jQuery = jQuery.noConflict();
> //Icon that is clicked
> var objectClickedID = '#' + RegionID + '_img';
> //Region to hide
> var objectID = '#' + RegionID;
> $jQuery(document).ready(function(){
> $jQuery(objectClickedID).click(function() {
> if ($x(objectID).style.display =='none') {
> $jQuery(objectID).show('slow');
> }
> else{
> $jQuery(objectID).hide('slow');
> }
> });
> }
> and my img is as following
>
>
> Code:
> and my region that I want to hide is
> Code:
> <div id="show_hide">Hide this</div>I know you might say that I could
> just hard code the div ID though I have a lot of divs and they img's
> need to hide specifc divs.
>
>
> Thanks for your support.
>
>
--
View this message in context:
http://www.nabble.com/jQuery-object-with-variable-id-name.-Is-is-possible--tp20268403s27240p20411033.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.