when I click on submit button url is:
http://localhost/college/index.php?field=1&exam=ATMA&submit3=%23success
I want to replace this link with:
http://localhost/college/index.php?field=1&exam=ATMA&submit3=#success
How can I do this ?
when I click on submit button url is:
http://localhost/college/index.php?field=1&exam=ATMA&submit3=%23success
I want to replace this link with:
http://localhost/college/index.php?field=1&exam=ATMA&submit3=#success
How can I do this ?
Share Improve this question asked Jan 17, 2017 at 10:06 sam ortensam orten 2064 silver badges18 bronze badges 1-
2
When you submit, is your backend expecting the value for
submit3
to be#success
? If so, don't change it, handle it in the backend. A#
has special meaning. it would be like trying to getsubmit3=&success
to have submit3 =&success
- you'd need to encode the&
in the same way that#
is encoded here. – fdomn-m Commented Jan 17, 2017 at 10:10
2 Answers
Reset to default 3The functions you are looking for are
PHP:
urlencode($string);
urldecode($string);
Javascript:
decodeURIComponent(string);
encodeURIComponent(string);
Try the following decodeURIComponent
:
decodeURIComponent('http://localhost/college/index.php?field=1&exam=ATMA&submit3=%23success')