Link to home
Start Free TrialLog in
Avatar of cempasha
cempasha

asked on

asp in .js file

hi there.
i have a form and retrieves some functions from .js file. what i'm trying to do is make the radio button checked if the value is 1.

my current code is

txtHTML = '<table><tr><td class="style19">Caching Server required</td><td class="style19"><input id="optCacheServer" name="optCacheServer" type="radio" value="1"  onChange="setRec();">Yes<input id="optCacheServer" name="optCacheServer" type="radio" value="0" onChange="setRec();" >No</td></tr></table>';


what i would like to do is actually
txtHTML = '<table><tr><td class="style19">Caching Server required</td><td class="style19"><input id="optCacheServer" name="optCacheServer" type="radio" value="1" <% if CSR2 = 1 then %> checked <% end if %> onChange="setRec();">Yes<input id="optCacheServer" name="optCacheServer" type="radio" value="0" <% if CSR2 = 0 then %> checked <% end if %> onChange="setRec();" >No</td></tr></table>';

however this doesnt work as it doesnt seem to accept asp codes. any ideas how i can achieve it ? thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of DavidBlackledge
DavidBlackledge

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cempasha
cempasha

ASKER

thanks for your help. i've ended up using

-- move your javascript content directly into your .asp file so it will process as you want (probably the easiest thing to do)

comment. however all seems great. thanks again