473,883 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Linking contents of text box to anchor HREF

30 New Member
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 6546
pbmods
5,821 Recognized Expert Expert
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 Recognized Expert Moderator MVP
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 New Member
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 Recognized Expert Moderator MVP
Post some HTML (your form) so we can work with that.
Jun 4 '07 #5
aRTx
30 New Member
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 Recognized Expert Moderator MVP
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="sendsm s()">...</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 New Member
the code:
[HTML]<html>
<head>


<script>

function sendsms() {
var to = "to="+encodeURI Component(docum ent.getElementB yId('to'). value);
// repeat for the rest of the fields then..
location.href = "sendsms.ph p?" + 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.smsdi scount.com/clx/sendsms.php?use rname=artx&pass word=bumbum&to& text" onclick="sendsm s()">...</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>f ailure</resultstring>
<description>Th e parameter to (destination number) is missing</description>
<endcause />
</SmsResponse>[/HTML]
Jun 5 '07 #8
aRTx
30 New Member
I have write some thing please chek it...
[HTML]<html>
<head>


<script>

function sendsms() {
var username = "account";
var password = "bllablla";
var to = "to="+encodeURI Component(docum ent.getElementB yId('to'). value);
var text = "text="+encodeU RIComponent(doc ument.getElemen tById('text'). value);


// repeat for the rest of the fields then..
location.href = "sendsms.ph p?" + 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="sendsm s()">...</a>
</body>
</html>[/HTML]

where is the mistake?.
Jun 5 '07 #9
acoder
16,027 Recognized Expert Moderator MVP
Replace sendsms.php in the sendsms function with the full URL:
https://myaccount.smsdi scount.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

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

Similar topics

0
2674
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 doc. The procedure for linking files with swish (same as Flash swf) is: on release { javascript('window.location.href('test.html#anchorname'); }
1
1206
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
2314
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 the anchor text does not contain the "@" symbol, clicking on the link works in a normal fashion. However, if the anchor text is something like "foo@test", then clicking on the text displays the full URL (still goes to the correct link, but I...
14
2795
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 Netscape and Explorer seem to assume that <A NAME> anchors target part of a vertical web page, where all that is needed is for the window to advance to the first character or whitespace after the target. In a horizontal page, this means that each...
17
4386
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' onclick='remember("conf.cgi")' onmouseover='handleOver("Configure stuff")'>Settings</a></li> </ul> with the JavaScript:
16
2573
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 file that has a CSS and two div sections, the body itself is empty. One div section has an embedded object of type "text/html" that is a table of contents. This embedded object includes links with target _top that are opened in Firefox in _top, but...
3
1602
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 be here, but since it does, I'd be interested in getting some different perspectives on this. I have an XML book and I plan to create XHTML so I'm looking for the best way to create links from the various components of the book to the page...
1
1638
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 details about the registration and then the form fields for the user to fill the registration page. i have used php to validate the form, presently when a user clicks the submit button and
4
8079
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
9791
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10742
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10414
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9572
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7971
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7125
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3232
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.