473,412 Members | 5,385 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,412 software developers and data experts.

How to change the Hidden Value from Javascript

46
Hell sir,
How to change the value of hidden field in a form from javascript code

Please reply me as soon..........


With regards,
Velmurugan.H
Nov 13 '06 #1
4 7073
Nert
64
Hell sir,
How to change the value of hidden field in a form from javascript code

Please reply me as soon..........


With regards,
Velmurugan.H
hi,

if you don't mind can you please clarify what your problem is. Well
any way this might help you, in javascript we have the function getElementById()
with this function you can distinguish which object you want to change the value, get the value or anything you want to do with the object within a document.

example i have this form without any button

<form name="sample" id="sample" method="post" action="sample.php">
<input type="text" name="text" value="Sample text" />
</form>

now i want to submit it with just clicking a plane text, i'll do that with just simple as this.

<p onClick="javascript: document.getElementById('sample').submit();">
Click This
</p>

try to expand my sample and you will get what you want to do in your project


bye bye

--nert
Nov 14 '06 #2
ronverdonk
4,258 Expert 4TB
This thread belongs in the Javascript forum, so I will move it.

Ronald :cool:
Nov 14 '06 #3
iam_clint
1,208 Expert 1GB
Example
Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" id="hiddenstuff" value="nothing">
  2. <input type="button" value="Change Hidden Text!" onclick="changehidden();">
  3. <script>
  4. function changehidden() {
  5. document.getElementById("hiddenstuff").value = "NEW HIDDEN STUFF!";
  6. }
  7. </script>
  8.  
Nov 14 '06 #4
suppose
Expand|Select|Wrap|Line Numbers
  1. <form name=TestName>
  2.      <input type=hidden name=MeWannaChange value=WhoCaresImGoingToChangeThis>
  3. </form>
  4.  
Then use
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. TestName.MeWannaChange = "NewValue";
  3. </script>
  4.  
-or-
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. document.TestName.MeWannaChange = "NewValue";
  3. </script>
  4.  
Nov 15 '06 #5

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

Similar topics

8
by: Matt Herson | last post by:
I have been trying to find a way to use JavaScript to change the value of a hidden field on submit. I am already invoking a JavaScript to handle the validation on submit. The reason I need to...
4
by: Wim Roffal | last post by:
Is it possible to use javascript to change the name of a field in a form? Thanks, Wim
2
by: RWD | last post by:
I am trying to figure out how to change the target frame in my hyperlink on a DHTML menu. The menu is in one frame and the target frame is called "main" The code is below: Thanks in advance...
3
by: Marc Castrechini | last post by:
I have a page that changes an <ASP:Checkbox value based on a user entered value in a textboxm using client side Javascript. After my submit is fired the value for the chkMyCB.checked does not get...
2
cassbiz
by: cassbiz | last post by:
I may be in the wrong forum so Ronald don't shoot :) In my code I have an option box to choose a number - works fine. I want to carry over the new value to another field to do a recalculation. ...
4
by: Bosconian | last post by:
I've been fighting with this for an hour. My form contains a hidden input with the value initially set to "". When a user clicks on the link, a function is called that updates the hidden form...
3
by: rag84dec | last post by:
Hi, i want to change the hidden elemtn value in the javascript. the name of the filed will have to be formed in the javascript. like this var temp="name"+1; document.temp.value="newname";
6
by: K Viltersten | last post by:
I have the following button: <asp:LinkButton id="Btn" runat="server" text="Click"> </asp:LinkButton> I have added an action listener in the javascript where I change the text on it:...
5
by: thatcollegeguy | last post by:
Below are my 3php and 2js files. I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
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?
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
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
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...
0
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...

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.