Getting value from a hidden parameters [Solved]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nahydy
Forum Commoner
Posts: 25
Joined: Wed Aug 22, 2007 5:55 am

Getting value from a hidden parameters [Solved]

Post by nahydy »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hi 
i 'm using zend framework and i created in my page web a form. this is the code

[syntax="html"]
<form action="<?php echo $this->baseUrl ?>/index/formulaire/" method="POST" id="form1">
<div id="Canvas" style="position:realtive;height:5px;width:5px;">
	<img  alt="map_pixels" src="<?php echo $this->baseUrl;?>/public/images/main.png" style="position: relative; top: 70px; left: 30px; visibility: visible;" usemap="#main" width="1000" height="1000"/>
</div>

<input type="text" value="" name="idText" />
<input type="hidden" value="gggg"  id="tabs_coords" />
<input type="submit" value="submit" id="submit"/>

</form>

as you can see this a simple form. In my controllers i tried to get the value of my input. i successfully got the value of idText using this codes:[/syntax]

Code: Select all

function formulaireAction()
{
	
	$this->view->title = "formulaire d'inscription";
	if ($this->_request->isPost()) 
	{
		
		$this->view->message=$this->_request->getPost('idText');
		//$this->view->message=$this->_request->getPost('tabs_coords');
		
		$this->render();
	}
}
but when i tried to get the value of tabs_coords it doesn't work. Shall i use a special comands to get the value of a hidden parameters?


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Steve Mellor
Forum Commoner
Posts: 49
Joined: Thu Aug 02, 2007 8:18 am

Post by Steve Mellor »

I think your problem lies here:

Code: Select all

id="tabs_coords"
Try changing this to

Code: Select all

name="tabs_coords"
or, if the id value is important as well, add this line instead.
nahydy
Forum Commoner
Posts: 25
Joined: Wed Aug 22, 2007 5:55 am

Post by nahydy »

tank you steve it worked. :)
Post Reply