rivkamak
asked on
jquery multiple selector options.
I am trying to get a complex jquery selector statement.
Something along this lines
($('input').attr('id', data.field) );
the selector that I need is :
the input field on my page. whose attribute ID matched the variable in data.field
but I need as output the value of the attribute 'value' of that specific input field.
how do I combine that together?
Something along this lines
($('input').attr('id', data.field) );
the selector that I need is :
the input field on my page. whose attribute ID matched the variable in data.field
but I need as output the value of the attribute 'value' of that specific input field.
how do I combine that together?
ASKER
How do I do the opposite?
the selector should be where the id is the value of the attribute 'data' on the field #popinput
Can i do something like this?
fieldname = $('#popinput').attr('data- name');
$(fieldname).attr('value', $('#popinput').val() );
the selector should be where the id is the value of the attribute 'data' on the field #popinput
Can i do something like this?
fieldname = $('#popinput').attr('data-
$(fieldname).attr('value',
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 for your help.
In concept it works great..
You can view my page here:
https://www.oorahauction.org/prizes.asp
if you put an quantity in the prize box, then click on the image, it will pop up with more information and the prize box in the popup will have the same amount as the box on the page.
if you change the amount in the popup box, when you close the popup , the field on the main page will adjust to that new amount
yet, when you click on another image, and the box pops open, the input box is still filled out with the amount you put in before, not matching that correct quantity of that prize.but if you check the code, the jquery worked and the value is blank.
Why is the input box showing an old number is the value in the code is really empty?
In concept it works great..
You can view my page here:
https://www.oorahauction.org/prizes.asp
if you put an quantity in the prize box, then click on the image, it will pop up with more information and the prize box in the popup will have the same amount as the box on the page.
if you change the amount in the popup box, when you close the popup , the field on the main page will adjust to that new amount
yet, when you click on another image, and the box pops open, the input box is still filled out with the amount you put in before, not matching that correct quantity of that prize.but if you check the code, the jquery worked and the value is blank.
Why is the input box showing an old number is the value in the code is really empty?
should return the value of the element whose id matches the value of data.field