voodoochicken Posted February 13, 2008 Share Posted February 13, 2008 hi, i want a script to behave according to the value in a var, but this value is not something the user enters in a text box, but rather, the page has lots of labels in a table, and besides each label there should be a button. if the user clicks on the button besides some label (not editable), the script should act according to the value in the label, or an internal field related to this labelthe page (or the table in the page) should have a form for each cell, with something like action="do_something" method=post etc submit, and when the user clicks on the submit button, there would be a post with a fixed value, but different for each form (different for each button, or each cell)any pointers? tnx Link to comment Share on other sites More sharing options...
justsomeguy Posted February 13, 2008 Share Posted February 13, 2008 When you write a function in a language like Javascript you can send the function parameters or arguments that it can read the value of and respond to accordingly. function test_func(a, b, c){ alert(a); return b + c;}test_func('test', 1, 2);test_func(100, 50, 50); Link to comment Share on other sites More sharing options...
voodoochicken Posted February 13, 2008 Author Share Posted February 13, 2008 When you write a function in a language like Javascript you can send the function parameters or arguments that it can read the value of and respond to accordingly.function test_func(a, b, c){ alert(a); return b + c;}test_func('test', 1, 2);test_func(100, 50, 50); umm.. tnx, no. the question is about html forms and post method, no functions in the same page. i want to send a value trough post method, like passing a parameter to a function, except the function that receives is not on the same page, and i want that the value for that parameter depends on which button (<input type="submit" />) is clicked. since the submit posts every input on the form, what i am thinking is to have many forms in the same page, each with one submit button, and every one would make a post for the same variable, but different value.or in other words, whats an equivalent for an <input type="text" etc>, but not editable by the user Link to comment Share on other sites More sharing options...
voodoochicken Posted February 13, 2008 Author Share Posted February 13, 2008 (me again). i found in dreamweaver a thing called 'hidden field' which is a named input field. will try with this, which seems to be what i was looking for Link to comment Share on other sites More sharing options...
Synook Posted February 13, 2008 Share Posted February 13, 2008 I.e. <input type="hidden" value="value" /> ? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.