views:

44

answers:

1

Hi,

Below is my code present in my application :

<input id="input" value="Testing" />

<a  href="/captures/getTranslation/?TB_iframe=true&amp;modal=true&amp;height=380&amp;width=670&amp;" name="Signup" id="signuplink" title="Post" > Test </a>

I am posting some data to one page, i am getting all the attached parameter in my result page.

Here i want to know how do i pass text value with href of anchor tag.

I tried something like this, but it's not working :

<a  href="/captures/getTranslation/?TB_iframe=true&amp;modal=true&amp;height=380&amp;width=670&amp;textBoxValue=$('#input').val();" name="Signup" id="signuplink" title="Post" > Test </a>

I have used overlay on onclick of anchor tag, if i add function over there then overlay wont come, due to that i m skipping function call on any events.

I am using jquery library also. But in result page i am not getting textBoxValue parameter.

Please suggest me guys, how to append parameter(input box value) in href attribute of achor tag using jquery

Thanks

-Pravin

A: 

Try changing the a to a button, or span and adding an onclick event, you can then redirect the users where ever you want with values from any element.

something like this:

<a  onclick="javascript:GoToUrl();"> Test </a>


<script type="javascript">

function GoToUrl()
{
var url = "/captures/getTranslation/?TB_iframe=true&amp;modal=true&amp;height=380&amp;width=670&amp;" + textBoxValue=$('#input').val();

window.location.href = url;
}

</script>
JamesStuddart
@JamesStuddart: Thanks a lot for ur quick reply. I have used overlay on click of anchor tag. If i use above function, then data will post properly, but i dont get overlay. Here i want to append value directly which i mentioned prob statement ( in href attribute using jquery ).
pravin
When you say overlay, do you mean the tooltip with the URL in it?
JamesStuddart
not james ...i am displaying small window having further procedure like login overlay ( currently available on twitter,i.e. login overlay, same thng will be der in my app )
pravin
Ok, I must be missing something here, but why not just use CSS to show and hide the overlay? as the twitter login window is only a relatively place div?
JamesStuddart
yup...m thinking sm...let's c...thanks James ur info helps me lot
pravin