Amanda Watson
asked on
How can I make this field pre - selected?
Hi There, On this site here
http://www.smokinhot.com.au/Go-through-checkout-process?redirected=1
If you select new user - you will see there is a user field that has NEWSLETTER - How can I make this preselected?
There isn't an option in the user field managment?
Thanks,
http://www.smokinhot.com.au/Go-through-checkout-process?redirected=1
If you select new user - you will see there is a user field that has NEWSLETTER - How can I make this preselected?
There isn't an option in the user field managment?
Thanks,
ASKER
No extension, its just virtuemars user fields
ASKER
just go to the shop add some items to your cart and proceed to checkout to see the new user section where you will see the newsletter field...i want it pre-selected
Do you mean the check box next to "Newsletter? If you want that checked by default just add the word "checked" to it.
Here is a sample.
<input type="checkbox" name="sample" checked />
The word checked will put a checkmark in the box.
Here is a sample.
<input type="checkbox" name="sample" checked />
The word checked will put a checkmark in the box.
ASKER
Where would I do this though?
This is dynamically generated somehow...?
This is dynamically generated somehow...?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Mmm... good question. I agree there doesn't seem to be any ability to use VM user field parameters - I would expect someone has documented a work around on the VM forums.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Might be a better idea to place the above code in this file instead as it already has a mootools function and it comes after the loading the mootools-release-1.11.js
http://www.smokinhot.com.au/components/com_virtuemart/js/mootools/mooPrompt.js
Cheers!
http://www.smokinhot.com.au/components/com_virtuemart/js/mootools/mooPrompt.js
Cheers!
ASKER
Hi, just checking remorina, but that code here:
window.addEvent('domready' , function() {
if ($('vm_newsletter_field')) {
$('vm_newsletter_field').c hecked=tru e;}
});
addded to http://www.smokinhot.com.au/components/com_virtuemart/js/mootools/mooPrompt.js
Is all i need to do to make that work?
Is that the correct field name...?
window.addEvent('domready'
if ($('vm_newsletter_field'))
$('vm_newsletter_field').c
});
addded to http://www.smokinhot.com.au/components/com_virtuemart/js/mootools/mooPrompt.js
Is all i need to do to make that work?
Is that the correct field name...?
did you try my suggestion yet? All you need to do is drop that javascript function into the page and change the id to the id of the checkbox and it will check the box when the page is loaded. Pretty simple to do!
@snowball77:
Yes, it should suffice to make it checked and the checkbox name is "vm_newsletter_field" as used in the code.
I've tested direct execution and it and it worked but you will need to try it yourself and see if it sucessfully executes or causes any errors, hopefully it shouldn't.
And the file mooPrompt.jos you pointed is the correct file you should place the block in, just make sure you add it at the bottom of the file after all other functions.
Cheers!
Yes, it should suffice to make it checked and the checkbox name is "vm_newsletter_field" as used in the code.
I've tested direct execution and it and it worked but you will need to try it yourself and see if it sucessfully executes or causes any errors, hopefully it shouldn't.
And the file mooPrompt.jos you pointed is the correct file you should place the block in, just make sure you add it at the bottom of the file after all other functions.
Cheers!
ASKER
remorina..that worked thanks.
elvin I am sure yours would work too I just took the easiet option here!
Thank you
elvin I am sure yours would work too I just took the easiet option here!
Thank you
ASKER
eww slight problem, this pre selected trick doesn't seem to be working in IE???
ASKER
Looks like elvin66 solution worked for all browsers....
Sorry I need to change the point allocation
Sorry I need to change the point allocation
Thanks Snowball. I knew it would work as I have used it myself but I'm glad you got it working.
ASKER
Ta
In any case what extension etc are you using to gather the new user info including newsletter option?