473,405 Members | 2,282 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,405 software developers and data experts.

Pass the value in javascript

190 100+
Hi all,

Its is an simple question, but for me it takes more than 2 hours.

Just i want to pass the value using java script function

See this

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE> New Document </TITLE>
  5. <META NAME="Generator" CONTENT="EditPlus">
  6. <META NAME="Author" CONTENT="">
  7. <META NAME="Keywords" CONTENT="">
  8. <META NAME="Description" CONTENT="">
  9. <script>
  10. function testfun()
  11. {
  12. var avar=document.mahes.test.value;
  13. document.mahes.action="testpage.php?testpass="+aa;
  14. document.mahes.submit;
  15. }
  16. </script>
  17. </HEAD>
  18.  
  19. <BODY>
  20. <form name="mahes" id="mahes" method="get">
  21. <input type="text" name="test" >
  22. <input type="submit" name="submit" value="submit" onclick="testfun()">
  23. </form>
  24. </BODY>
  25. </HTML>
  26.  


but i got only

http://localhost/test/testpage.php?test=enteredval&submit=submit

That is if i have input box then only i can able to pass value of the inputbox

But i want to be the url as like

http://localhost/test/testpage.php?testpass=its me

tesspass is the my custom variable ...How i can get it...
Dec 15 '10 #1
3 1440
acoder
16,027 Expert Mod 8TB
You could have a hidden field.

aa would not be defined in your code anyway.
Dec 16 '10 #2
maheswaran
190 100+
is there any way to pass the javascript value using my custom variable as like

http://localhost/test/testpage.php?testpass=value
Dec 17 '10 #3
acoder
16,027 Expert Mod 8TB
If you have this hidden field:
Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" name="testpass" value="value">
this will be passed in the URL. Of course, you can set the value before submitting.

One quick note: submit is not a function call. submit() is.
Dec 17 '10 #4

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

Similar topics

1
by: Al | last post by:
Ref:how to pass value along with click of a button hi,I have created a form that has single button. as follow <asp:button id="btnCallfunction" runat="server" text="func_call" onclick="add_int" />...
3
by: john woo | last post by:
Hi in JSP, it's easy to pass value from java-variable to javascript-variable, like js_function(a) { a=<%java-class.A%> } I'm wondering how is the other way around? I tried
3
by: pei_world | last post by:
I have a user control: - using LoadControl("MyCtrl.ascx") MyCtrl _mycontrol = (MyCtrl)LoadControl("MyCtrl.ascx") Page.Controls.Add(_mycontrol); _mycontrol.Text it will be loaded when some...
1
by: pei_world | last post by:
I have a user control: - using LoadControl("MyCtrl.ascx") MyCtrl _mycontrol = (MyCtrl)LoadControl("MyCtrl.ascx") Page.Controls.Add(_mycontrol); _mycontrol.Text it will be loaded when some...
3
by: startsmart | last post by:
Hi This is first time to write and alse it is first time to show this site my problem is i need to pass value from any input type like text for example to hidden field I tried to make a...
1
by: jadeivel756 | last post by:
I BADLY NEED YOUR HELP...... HELP... hOW TO Pass value to a struct type and permanently store the data after youve given the data.The programming language is C. My problem is that as I exit the...
4
by: jadeivel756 | last post by:
I BADLY NEED YOUR HELP...... HELP... hOW TO Pass value to a struct type and permanently store the data after youve given the data.The programming language is C. My problem is that as I exit the...
4
by: IRC | last post by:
hey, i am pretty new on javascript as well as PHP, Hey, anyone can you help me, how to pass the javascript array value to php page......... i want to retrieve the values which are arrayed on...
0
by: perdijc | last post by:
I create a dataset via visual studio wizard and then I drag some columns to a form in details mode. So in my form I have some coontrols binding to bindingsource. If a run the project, all controls...
7
gskoli
by: gskoli | last post by:
I have created a gif based digital clock but problem is that it will show me the client side time . I am a perl developer so i am getting server time, i mean , i can fetch that time , to pass the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...
0
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...
0
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...

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.