0

I want to open http://10.41.30.88/mmisweb/plpodtl.asp?pl=30010111 in another tab, where user has to input the last eight digits. (Which is 30010111 in this case for example).

For input I have to use HTML page and JavaScript. I used the following -

<!DOCTYPE html>
<html>
<body>

<a href="http://10.41.30.88/mmisweb/plpodtl.asp?pl=" id="baseUrl">Link Text</a>
<input type="text" id="appendUrl" onclick="ass();return false; "/>
<script>
function ass() {

        window.location = $(this).attr('href')  + $('#appendUrl').val();
        return false;
    }
</script>

</body>
</html> 

But it returns only http://10.41.30.88/mmisweb/plpodtl.asp?pl= in the window and not the digits.

1
  • This change also didn't help. Still the digits are not returned. Commented Jul 15, 2015 at 10:20

1 Answer 1

1

Onclick must be in the link....

 <a href="http://10.41.30.88/mmisweb/plpodtl.asp?pl=" id="baseUrl" onclick="ass();">

You have return false too, is no neccesary in onclick.

Sign up to request clarification or add additional context in comments.

2 Comments

The original problem remains. The digits are not returned.
It's because your code is very bad structurate. See this fiddle and it works: jsfiddle.net/ef9jnrvz Only you must to change your thinking and all is ok

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.