Extracting search front edn logic in javascript mogule. \nStill has to remove replace some hiddenf ield with js variables