473,387 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Linking contents of text box to anchor HREF

30
I want to send sms from my sajt, i have some code but i don't know enaught.

I have an account in one of sms service server ...

code:
Expand|Select|Wrap|Line Numbers
  1. <a href = "http://www.myaccount.com/artxcenter.com/sendsms.php?username=xxx&password=xxx&from=xxx&to=xxxx&text=xxx"> Click here to send sms </a>
[Please use CODE tags when posting source code. Thanks! --pbmods]

if you write right username and password and to (number of phone you will send sms ) .

My problem:
how to link with TEXT box
plz help me
Jun 3 '07 #1
17 6480
pbmods
5,821 Expert 4TB
Changed thread title to better match contents.

Heya, aRTx. Welcome to TSDN!

I'm moving this thread to the JavaScript forum where it will get more relevant exposure.
Jun 4 '07 #2
acoder
16,027 Expert Mod 8TB
My problem:
how to link with TEXT box
plz help me
Say you have a textbox with an id of "username", then you would access it using:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("username").value
To add this to the URL, you could call a function which retrieves the values from the textboxes and adds them, e.g.
Expand|Select|Wrap|Line Numbers
  1. urlparams = "username="+document.getElementById("username").value;
  2. urlparams += "&password="+...//etc.
Jun 4 '07 #3
aRTx
30
thnx for help, but i don't know how to use your code to resolve this problem, I'm biginer in this area.


Please post an concrete example plz....

I APPRECIATE your knowlodge...
Jun 4 '07 #4
acoder
16,027 Expert Mod 8TB
Post some HTML (your form) so we can work with that.
Jun 4 '07 #5
aRTx
30
Post some HTML (your form) so we can work with that.
i have upload something about this "sms links" sms-links.zip

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. </head>
  5.  
  6. <body>
  7. <form id="form1" name="form1" method="post" action="">
  8.   <label><br />
  9.   Mobile number to:
  10.   <input type="text" name="to" id="to" />
  11.   </label>
  12. </form>
  13. <p>&nbsp;</p>
  14. <form id="form2" name="form2" method="post" action="">
  15.   <label>here sms text
  16.   <textarea name="text" id="text" cols="45" rows="5"></textarea>
  17.   </label>
  18. </form>
  19. <p>&nbsp;</p>
  20. </body>
  21. </html>
i don't know how to use it:
Expand|Select|Wrap|Line Numbers
  1. https://myaccount.smsdiscount.com/clx/sendsms.php?username=xxxxxxxxxx&password=xxxxxxxxxx&from=xxxxxxxxxx&to=xxxxxxxxxx&text=xxxxxxxxxx

plz help to do it ....
Jun 4 '07 #6
acoder
16,027 Expert Mod 8TB
You have two forms. Make them into one.

Do you only want the "to" and "text" fields in the form. Where will the other fields be set?

Ok, let's assume that you only want the "to" and "text" fields from the form. First of all, in your link, change the href to "#" and add an onclick to call a function:
[HTML]<a href="#" onclick="sendsms()">...</a>[/HTML]
In this function, set the parameters for the url:
Expand|Select|Wrap|Line Numbers
  1. function sendsms() {
  2.  var to = "to="+encodeURIComponent(document.getElementById('to').value);
  3.  // repeat for the rest of the fields then..
  4.  location.href = "sendsms.php?" + username + "&" + password ... + "&" + to + ...;
  5. }
Jun 5 '07 #7
aRTx
30
the code:
[HTML]<html>
<head>


<script>

function sendsms() {
var to = "to="+encodeURIComponent(document.getElementById(' to'). value);
// repeat for the rest of the fields then..
location.href = "sendsms.php?" + username + "&" + password ... + "&" + to + ...;
}
</script>



<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
<form id="form1" name="form1" method="post" action="">
<label><br />
Mobile number to:
<input type="text" name="to" id="to" />
</label>
</form>
<p>&nbsp;</p>
<form id="form2" name="form2" method="post" action="">
<label>here sms text
<textarea name="text" id="text" cols="45" rows="5"></textarea>
</label>
</form>
<p>&nbsp;</p>
<a href="https://myaccount.smsdiscount.com/clx/sendsms.php?username=artx&password=bumbum&to&text" onclick="sendsms()">...</a>
</body>
</html>[/HTML]


this code when excute return a failed mesage:
[HTML] <?xml version="1.0" encoding="utf-8" ?>
- <SmsResponse>
<version>1</version>
<result>0</result>
<resultstring>failure</resultstring>
<description>The parameter to (destination number) is missing</description>
<endcause />
</SmsResponse>[/HTML]
Jun 5 '07 #8
aRTx
30
I have write some thing please chek it...
[HTML]<html>
<head>


<script>

function sendsms() {
var username = "account";
var password = "bllablla";
var to = "to="+encodeURIComponent(document.getElementById(' to'). value);
var text = "text="+encodeURIComponent(document.getElementById ('text'). value);


// repeat for the rest of the fields then..
location.href = "sendsms.php?" + username + "&" + password + "&" + to;
}
</script>



<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
<form id="form1" name="form1" method="post" action="">
<label><br />
Mobile number to:
<input type="text" name="to" id="to" />
</label>
</form>
<p>&nbsp;</p>
<form id="form2" name="form2" method="post" action="">
<label>here sms text
<textarea name="text" id="text" cols="45" rows="5"></textarea>
</label>
</form>
<p>&nbsp;</p>
<a href=" what to write here plz..." onclick="sendsms()">...</a>
</body>
</html>[/HTML]

where is the mistake?.
Jun 5 '07 #9
acoder
16,027 Expert Mod 8TB
Replace sendsms.php in the sendsms function with the full URL:
https://myaccount.smsdiscount.com/clx/sendsms.php?

Also, you will need to change username and password to include "username=" and "password=". You've also forgotten to add the 'text' to the url.

As for the href of the link, a hash (#) should suffice.
Jun 6 '07 #10
aRTx
30
if we have html code:

[HTML]<html>
<form>
<input type="text" name="fieldOne">
</form>
</html>
[/HTML]

how to get contets and with this contets make an link:
example:
http://www.herefromtextbox".com
Jun 6 '07 #11
aRTx
30
How to make and call a function wich can take contets from "textbox" by clik on a button

[HTML]
<HTML>
<form>
<input type="text" name="fieldOne">
</form>
</html>
[/HTML]

and then contets convert to a link:
www.contents.com
Jun 6 '07 #12
aRTx
30
I have a problem..
I am gona make a html form to send sms from my sajt.
i can send sms because i have an account in www.smsdiscout.com and they let us to send with a code

<a href="http://www.smsdiscount.com/clx/sendsms.php?username="xxx"&password="xxx"&to="xxx" &text="xxx"> Clik to send sms </a>

but how to turn it in a html form with textbox-es


I know i have post this problem more than one time, but i can't find concret code to do it...
Jun 6 '07 #13
r035198x
13,262 8TB
if we have html code:

[HTML]<html>
<form>
<input type="text" name="fieldOne">
</form>
</html>
[/HTML]

how to get contets and with this contets make an link:
example:
<A href="http://www.herefromtextbox".com[/QUOTE">http://www.herefromtextbox".com
Where do you want to put this link? Write a function which simply takes the value on the input box and sets it as the href of your link.
Jun 7 '07 #14
ak1dnar
1,584 Expert 1GB
[HTML]<HTML>
<head>
<script language="JavaScript" type="text/javascript">
function func_call(linkStr)
{
document.getElementById("link").innerHTML = '<a href="http://www.'+linkStr+'.com">'+linkStr+'</a>';
}
</script>
</head>
<body>
<div id="link"></div>
<form>
<input type="text" name="fieldOne" id="fieldOne" >
<input name="btn" value="CLICK" type="button" onclick="javascript:func_call(fieldOne.value);">
</form>
</body>
</html>
[/HTML]
Jun 7 '07 #15
aRTx
30
thnx very much,
you have resolve my problem i have post it in 14 way in this forum but you have do it in good way.


i am gona ask again

how to get from two textboxes and when you will click the link will be exceute in the same page
Jun 7 '07 #16
ak1dnar
1,584 Expert 1GB
thnx very much,
you have resolve my problem i have post it in 14 way in this forum but you have do it in good way.
Once you post a thread in the forum, you wont be able to get a answer shortly.You have to wait sometimes until another member comes to the thread.

how to get from two textboxes and when you will click the link will be exceute in the same page
Better if you can further explain it. The most suited way for this,you can post the coding that you made so far here in the forum.

Are you looking for something like this.

for the Onclick event of button you can pass both the text box values like this.
Expand|Select|Wrap|Line Numbers
  1. func_call(fieldOne.value,fieldTwo.value)
  2.  
then from your js function you have to accept two parameters.

Expand|Select|Wrap|Line Numbers
  1. function func_call(linkStr_1,linkStr_2)
  2. {
  3.  
  4. }
link will be exceute in the same page
I am waiting for your further details about this.
Jun 8 '07 #17
acoder
16,027 Expert Mod 8TB
Merged the threads - same topic.
Jun 8 '07 #18

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: nam | last post by:
could someone please help me with this bizarre problem - I've created a swf file at the top of my html page. The swf file (using Swish) is simply a menu of 5 links to 5 anchor points on the html...
1
by: Ang Talunin | last post by:
Hey, I've got this code: <html> <head> <style> a{cursor:hand;text-decoration:none;font-size=10pt;font-family:Verdana;} a:hover{cursor:hand;text-decoration:underline;} </style>
3
by: ehm | last post by:
I have encountered an issue that has me totally confused. I have a page where the user clicks on a hyper-text link and is then directed towards another page (passing additional variables, etc.). If...
14
by: eric | last post by:
I am attempting to create <A HREF> links to <A NAME> targets in a series of extremely wide web pages composed of tables with text and images sitting side by side. This is a failure since both...
17
by: Christopher Nelson | last post by:
I have a menu tree made up of anchors inside list items in a multi-level list that includes HTML like: <ul id='xx'> <li><a href='conf.cgi' class='menu' target='main' title='Configure stuff'...
16
by: Thomas Maier-Komor | last post by:
Hi everybody, I have a problem with a certain link pattern that gets resolved wrong in the IE, but works find on Firefox. Maybe somebody has an idea, how to work around it. I have an .html...
3
by: provowallis | last post by:
I'm new to this board so I hope this reqest isn't out of line, but I'm looking for some general advice about creating links in online books. If the link target didn't involve PIs I don't think I'd...
1
by: Sudhakar | last post by:
i am using a self submitting for using php <form action="<?php echo $_SERVER; ?>" method="POST" id="test2" name="registrationform"> the registration page starts with a lot of terms and other...
4
by: naveenmurthy | last post by:
Hello All, I have created a .mht file in following format. 1. The .mht file contains following htmls. a. MHTLinkingProblem.html b. Left.html c. Right.html d. Start.html
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.