![]() |
|
how can i use a regular expression in java script to get a value from page source cod - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Coding (https://sinister.ly/Forum-Coding--71) +--- Thread: how can i use a regular expression in java script to get a value from page source cod (/Thread-how-can-i-use-a-regular-expression-in-java-script-to-get-a-value-from-page-source-cod) |
how can i use a regular expression in java script to get a value from page source cod - mooooon - 06-08-2019 here is the function from the source code Code: function dosubmit()
{
if (getObj("Frm_Username").value == "")
{
getObj("errmsg").innerHTML = "Username cannot be empty.";
getObj("myLayer").style.visibility = "visible" ;
return;
}
else
{
getObj("LoginId").disabled = true;
getObj("Frm_Logintoken").value = "3";
document.fLogin.submit();
}
}i want to get the value of getObj("Frm_Logintoken") as i can't pull the value from #Frm_Logintoken using Code: document.getElementById("#Frm_Logintoken")because Frm_Logintoken only gets it's value when i click submit . Code: <input type="hidden" name="Frm_Logintoken" id="Frm_Logintoken" value="">i found this online Code: /getObj("Frm_Logintoken").value = "(.*)";/ganother regular expression i found but don't even know how to use it Quote:Example of a regular expression to search: before_egrep='N1:getObj("Frm_Logintoken").value = "(\w+)"'i am trying to make an auto login script that works in the background like it doesn't show the user the login form page but the only the page after it and i have found this code online too but don't know what's about it contains xhr . the line that Attracted my attention is Code: /getObj\("Frm_Logintoken"\).value = "(.*)";/gsome notes : i have tried Code: document.getElementById("Frm_Logintoken").valuebecause Quote:Frm_Logintoken only gets it's value when i click submit . the page will not even accept the correct password if the Frm_Logintoken token value isn't the same as one in the page. the Frm_Logintoken is a token generated by the page and it basically increment by one on each successful login. |