php - JQuery set default is value is passed using url -
this question continuation of on previous question on jquery next class guys helped me issue.
now have problem in setting default values. there 2 parts.
1st part: there link loads default item1, item2 , maybe item2 have done link pass values through url this
index.php?item1=3 now how check , enable respectively? have used php check , set disabled in if nothing passed, when passed dosnt set disabled. problem 2nd item value has not been passed disabled (item1 enabled , set default ids passed & item2, item3 disabled) , enable item2 have reselect item1.
because, according jquery item2 unlocked when item1 changes. how override this?
2nd part: similar first pages item1 set default in code () , nothing passed via url. issue same again.
i know both of similar issues, wondering if there easy solution rather changing part2 part1 i.e passing item1 via url (i have manually go each page , change :( ).
hey need check value of parameter name through this link. , check whether value null or not.and perform operation on not null value.
function getparameterbyname(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexs = "[\\?&]" + name + "=([^&#]*)"; var regex = new regexp(regexs); var results = regex.exec(window.location.search); if(results == null) return ""; else return decodeuricomponent(results[1].replace(/\+/g, " ")); } this way can call function value:
var value = getparameterbyname("item1");
Comments
Post a Comment