html - Dynamically read GET string of a form using javascript -
tl;dr: want easy way retrieve get-string created form dynamically load according data without refreshing.
normally, pressing submit on form:
<form action = "action.php" method="get"> <p> <input type="text" name="foo" value="bar" /> <input type="checkbox" name="check" value="true" checked="checked" /> <input type="submit" /> </p> </form>
would create , access string: action.php?foo=bar&check=true
i access string without reloading , without having fiddle iterating form elements (which i'm doing @ moment). aim put string xmlhttprequest if in form changes can update data on webpage accordingly.
var string = $("form").serialize();
Comments
Post a Comment