Jump to content

inserting a variable into a MM_goToURL link


Recommended Posts

I am new to this, and after I've searched a bunch of forums and tried it on my own I didn't succed in accomplishing what I wanted, i.e. :

 

I want to have a text field, in which I will write a number. Then i want a Button to have a MM_goToURL on click action to a Link which has a variable in it with the value from the input text field.

 

To be more precise here is a part of the code:

 

the MM_goToURL function:

 

<script type="text/javascript">

function MM_goToURL() { //v3.0

  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;

  for (i=0; i<(args.length-1); i+=2) eval(args+".location='"+args[i+1]+"'");

}

</script>

 

My text field:

 

<input name="12" type="text" id="ip" value="1" />

 

My Button:

 

<input name="3" type="submit" id="GO" onclick="MM_goToURL('parent','1.1.1.my_var');return document.MM_returnValue" value="Submit" />

<label for="1"></label>

 

So how can I declare my_var so it will always take the value inside the Input text field, and how do I include that variable inside the link, because just plain writing the name of the variable in there like :MM_goToURL('parent','1.1.1.my_var') won't work.

 

Thank you.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.